LukasKalbertodt / libtest-mimic

A small test framework to write your own test harness that looks and behaves like the built-in test harness used by `rustc --test`
https://docs.rs/libtest-mimic
Apache License 2.0
95 stars 26 forks source link

mixed_bag::terse_output test fails #26

Closed Dinnerbone closed 1 year ago

Dinnerbone commented 1 year ago

It relies on the duration always being 0s and apparently my PC is being pessimistic and rounds it up.

image

thread 'terse_output' panicked at 'assertion failed: `(left == right)`

Diff < left / right > :
 running 16 tests
 .F.Fiiii.F.Fiiii
 failures:

 ---- dog ----
 was not a good boy

 ---- bunny ----
 jumped too high

 ---- blue ----
 sky fell down

 ---- green ----
 was poisoned

 failures:
     dog
     bunny
     blue
     green

<test result: FAILED. 4 passed; 4 failed; 8 ignored; 0 measured; 0 filtered out; finished in 0.01s
>test result: FAILED. 4 passed; 4 failed; 8 ignored; 0 measured; 0 filtered out; finished in 0.00s

', tests\mixed_bag.rs:502:5
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library\std\src\panicking.rs:575
   1: core::panicking::panic_fmt
             at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library\core\src\panicking.rs:65
   2: mixed_bag::terse_output
             at .\tests\mixed_bag.rs:502
   3: mixed_bag::terse_output::closure$0
             at .\tests\mixed_bag.rs:493
   4: core::ops::function::FnOnce::call_once<mixed_bag::terse_output::closure_env$0,tuple$<> >
             at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6\library\core\src\ops\function.rs:251
   5: core::ops::function::FnOnce::call_once
             at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library\core\src\ops\function.rs:251
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
LukasKalbertodt commented 1 year ago

Ouchy. Yeah, I figured this would bite me eventually :D