Skip to content

Commit 4770446

Browse files
committed
add test
1 parent 3ad3597 commit 4770446

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

src/test/rustdoc-ui/no-run-flag.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// test the behavior of the --no-run flag
2+
3+
// check-pass
4+
// compile-flags:-Z unstable-options --test --no-run --test-args=--test-threads=1
5+
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
6+
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
7+
8+
/// ```
9+
/// let a = true;
10+
/// ```
11+
/// ```should_panic
12+
/// panic!()
13+
/// ```
14+
/// ```ignore
15+
/// fn foo() {
16+
/// ```
17+
/// ```no_run
18+
/// loop {
19+
/// println!("Hello, world");
20+
/// }
21+
/// ```
22+
/// fails to compile
23+
/// ```compile_fail
24+
/// let x = 5;
25+
/// x += 2; // shouldn't compile!
26+
/// ```
27+
/// Ok the test does not run
28+
/// ```
29+
/// panic!()
30+
/// ```
31+
/// Ok the test does not run
32+
/// ```should_panic
33+
/// loop {
34+
/// println!("Hello, world");
35+
/// panic!()
36+
/// }
37+
/// ```
38+
pub fn f() {}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
running 7 tests
3+
test $DIR/no-run-flag.rs - f (line 11) ... ok
4+
test $DIR/no-run-flag.rs - f (line 14) ... ignored
5+
test $DIR/no-run-flag.rs - f (line 17) ... ok
6+
test $DIR/no-run-flag.rs - f (line 23) ... ok
7+
test $DIR/no-run-flag.rs - f (line 28) ... ok
8+
test $DIR/no-run-flag.rs - f (line 32) ... ok
9+
test $DIR/no-run-flag.rs - f (line 8) ... ok
10+
11+
test result: ok. 6 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in $TIME
12+

0 commit comments

Comments
 (0)