From 2b2029fca18b9383bbfd16b099bd5d6c60a1d354 Mon Sep 17 00:00:00 2001 From: Yehuda-blip Date: Sat, 13 Jul 2024 14:16:48 +0300 Subject: [PATCH] show 'cargo-expnad' errors when testing an exercise --- src/test.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test.rs b/src/test.rs index 377514e..5f9db16 100644 --- a/src/test.rs +++ b/src/test.rs @@ -38,6 +38,12 @@ pub fn test(exercise: String) -> Result<(), Box> { .output() .unwrap(); + if !&main_output.status.success() { + println!("macrokata has encountered the following errors when attempting to expand an exercise."); + io::stderr().write_all(&main_output.stderr)?; + return Err("macrokata could not expand macros".into()); + } + println!(); println!("This is the expansion you produced:"); println!();