Use eprint!
instead of eprintln!
This commit is contained in:
parent
fff2484700
commit
f9927ee042
4 changed files with 23 additions and 33 deletions
|
@ -131,7 +131,7 @@ mod __doctest_mod {{
|
|||
.output()
|
||||
.expect(\"failed to run command\");
|
||||
if !out.status.success() {{
|
||||
eprintln!(\"{{}}\", String::from_utf8_lossy(&out.stderr));
|
||||
eprint!(\"{{}}\", String::from_utf8_lossy(&out.stderr));
|
||||
ExitCode::FAILURE
|
||||
}} else {{
|
||||
ExitCode::SUCCESS
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
//@ edition: 2024
|
||||
//@ compile-flags: --test
|
||||
//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
|
||||
//@ normalize-stdout: "panicked at .+rs:" -> "panicked at $$TMP:"
|
||||
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||
//@ rustc-env:RUST_BACKTRACE=0
|
||||
//@ failure-status: 101
|
||||
|
||||
//! ```rust
|
20
tests/rustdoc-ui/doctest/edition-2024-error-output.stdout
Normal file
20
tests/rustdoc-ui/doctest/edition-2024-error-output.stdout
Normal file
|
@ -0,0 +1,20 @@
|
|||
|
||||
running 1 test
|
||||
test $DIR/edition-2024-error-output.rs - (line 12) ... FAILED
|
||||
|
||||
failures:
|
||||
|
||||
---- $DIR/edition-2024-error-output.rs - (line 12) stdout ----
|
||||
|
||||
thread 'main' panicked at $TMP:6:1:
|
||||
assertion `left == right` failed
|
||||
left: 4
|
||||
right: 5
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
|
||||
|
||||
failures:
|
||||
$DIR/edition-2024-error-output.rs - (line 12)
|
||||
|
||||
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
|
||||
running 1 test
|
||||
test tests/rustdoc-ui/edition-2024-doctest-error-output.rs - (line 10) ... FAILED
|
||||
|
||||
failures:
|
||||
|
||||
---- tests/rustdoc-ui/edition-2024-doctest-error-output.rs - (line 10) stdout ----
|
||||
|
||||
thread 'main' panicked at /tmp/rustdoctestSZq9aS/doctest_bundle_2024.rs:6:1:
|
||||
assertion `left == right` failed
|
||||
left: 4
|
||||
right: 5
|
||||
stack backtrace:
|
||||
0: __rustc::rust_begin_unwind
|
||||
1: core::panicking::panic_fmt
|
||||
2: core::panicking::assert_failed_inner
|
||||
3: core::panicking::assert_failed
|
||||
4: doctest_bundle_2024::__doctest_0::main
|
||||
5: doctest_bundle_2024::__doctest_0::__main_fn
|
||||
6: doctest_runner_2024::__doctest_0::TEST::{{closure}}
|
||||
7: core::ops::function::FnOnce::call_once
|
||||
8: doctest_runner_2024::main
|
||||
9: core::ops::function::FnOnce::call_once
|
||||
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
|
||||
|
||||
|
||||
|
||||
failures:
|
||||
tests/rustdoc-ui/edition-2024-doctest-error-output.rs - (line 10)
|
||||
|
||||
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue