diff options
| author | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-02-06 12:26:33 +0100 |
|---|---|---|
| committer | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-02-06 12:26:33 +0100 |
| commit | 98adb0fd825aa3aca1bf531a0013227b56b5290c (patch) | |
| tree | 72a82755da39a3ee3a5ecfd42bd7ac529539e074 /src/lib.rs | |
| parent | 98df292fe4142fcc836013341579ed4437a2a464 (diff) | |
| download | sylt-98adb0fd825aa3aca1bf531a0013227b56b5290c.tar.gz | |
print the pretty errors on failed tests
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -734,7 +734,16 @@ mod tests { ($fn:ident, $prog:literal) => { #[test] fn $fn() { - $crate::run_string($prog, true, Vec::new()).unwrap(); + match $crate::run_string($prog, true, Vec::new()) { + Ok(()) => {}, + Err(errs) => { + for e in errs.iter() { + println!("{}", e); + } + println!(" {} - FAILED\n", stringify!($fn)); + unreachable!(); + } + } } }; ($fn:ident, $prog:literal, $errs:tt) => { |
