aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorEdvard Thörnros <edvard.thornros@gmail.com>2021-02-06 12:26:33 +0100
committerEdvard Thörnros <edvard.thornros@gmail.com>2021-02-06 12:26:33 +0100
commit98adb0fd825aa3aca1bf531a0013227b56b5290c (patch)
tree72a82755da39a3ee3a5ecfd42bd7ac529539e074 /src/lib.rs
parent98df292fe4142fcc836013341579ed4437a2a464 (diff)
downloadsylt-98adb0fd825aa3aca1bf531a0013227b56b5290c.tar.gz
print the pretty errors on failed tests
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index cca1a58..a377b29 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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) => {