trpl-zh-cn/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/output.txt

25 lines
919 B
Plaintext
Raw Normal View History

2022-02-06 16:43:51 +08:00
$ cargo test
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.66s
2023-01-16 17:34:52 +08:00
Running unittests src/lib.rs (target/debug/deps/guessing_game-57d70c3acb738f4d)
2022-02-06 16:43:51 +08:00
running 1 test
test tests::greater_than_100 - should panic ... FAILED
failures:
---- tests::greater_than_100 stdout ----
thread 'tests::greater_than_100' panicked at src/lib.rs:12:13:
Guess value must be greater than or equal to 1, got 200.
2022-02-06 16:43:51 +08:00
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: panic did not contain expected string
panic message: `"Guess value must be greater than or equal to 1, got 200."`,
2023-01-16 17:34:52 +08:00
expected substring: `"less than or equal to 100"`
2022-02-06 16:43:51 +08:00
failures:
tests::greater_than_100
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`