From 2f17a52373ddf27697c2d5ab6a32f8a7349bf7e9 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 7 Apr 2020 12:34:30 +0200 Subject: [PATCH] test(interface-types) Update the `test_executable_instruction` macro. It provides a better failure message. --- src/macros.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/macros.rs b/src/macros.rs index 8ff4109..be60ac0 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -111,7 +111,12 @@ macro_rules! test_executable_instruction { let mut instance = $instance; let run = interpreter.run(&invocation_inputs, &mut instance); - assert!(run.is_ok()); + let err = match &run { + Ok(_) => "".to_string(), + Err(e) => e.to_string(), + }; + + assert!(run.is_ok(), err); let stack = run.unwrap();