trpl-zh-cn/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/output.txt

23 lines
725 B
Plaintext
Raw Normal View History

2022-02-06 16:43:51 +08:00
$ cargo test
Compiling greeter v0.1.0 (file:///projects/greeter)
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.93s
2023-01-16 17:34:52 +08:00
Running unittests src/lib.rs (target/debug/deps/greeter-170b942eb5bf5e3a)
2022-02-06 16:43:51 +08:00
running 1 test
test tests::greeting_contains_name ... FAILED
failures:
---- tests::greeting_contains_name stdout ----
thread 'tests::greeting_contains_name' panicked at src/lib.rs:12:9:
Greeting did not contain name, value was `Hello!`
2022-02-06 16:43:51 +08:00
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
tests::greeting_contains_name
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
2023-01-16 17:34:52 +08:00
error: test failed, to rerun pass `--lib`