diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-07-09 11:06:20 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-07-18 12:07:51 +0200 |
| commit | d5e32947344751a421c85aed2e4dd370160f5470 (patch) | |
| tree | 3ad2ded35b1b02a9e627e5f3ecb871034e3f8d3f /src/test/rustdoc-ui | |
| parent | 6461cde51f1885f3c5e96e26debcfc6d82285b7b (diff) | |
| download | rust-d5e32947344751a421c85aed2e4dd370160f5470.tar.gz rust-d5e32947344751a421c85aed2e4dd370160f5470.zip | |
Add invalid rust code for test
Diffstat (limited to 'src/test/rustdoc-ui')
| -rw-r--r-- | src/test/rustdoc-ui/nocapture-fail.rs | 12 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/nocapture-fail.stderr | 18 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/nocapture-fail.stdout | 6 |
3 files changed, 36 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/nocapture-fail.rs b/src/test/rustdoc-ui/nocapture-fail.rs new file mode 100644 index 00000000000..7706bd1f3e3 --- /dev/null +++ b/src/test/rustdoc-ui/nocapture-fail.rs @@ -0,0 +1,12 @@ +// check-pass +// compile-flags:--test -Zunstable-options --nocapture +// normalize-stderr-test: "src/test/rustdoc-ui" -> "$$DIR" +// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" +// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" + +/// ```compile_fail +/// fn foo() { +/// Input: 123 +/// } +/// ``` +pub struct Foo; diff --git a/src/test/rustdoc-ui/nocapture-fail.stderr b/src/test/rustdoc-ui/nocapture-fail.stderr new file mode 100644 index 00000000000..16a5ac47cd2 --- /dev/null +++ b/src/test/rustdoc-ui/nocapture-fail.stderr @@ -0,0 +1,18 @@ +error: struct literal body without path + --> $DIR/nocapture-fail.rs:8:10 + | +LL | fn foo() { + | __________^ +LL | | Input: 123 +LL | | } + | |_^ + | +help: you might have forgotten to add the struct literal inside the block + | +LL | fn foo() { SomeStruct { +LL | Input: 123 +LL | } } + | + +error: aborting due to previous error + diff --git a/src/test/rustdoc-ui/nocapture-fail.stdout b/src/test/rustdoc-ui/nocapture-fail.stdout new file mode 100644 index 00000000000..754f77db53c --- /dev/null +++ b/src/test/rustdoc-ui/nocapture-fail.stdout @@ -0,0 +1,6 @@ + +running 1 test +test $DIR/nocapture-fail.rs - Foo (line 7) - compile fail ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME + |
