From cb265e1756902e3dfe56a0ee8e649d8d51f27535 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Mon, 7 Oct 2024 19:52:51 +0300 Subject: [PATCH] feat(#28): test message --- src/transpiler/errors/invalid_application_ref.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/transpiler/errors/invalid_application_ref.rs b/src/transpiler/errors/invalid_application_ref.rs index 97db230..734e559 100644 --- a/src/transpiler/errors/invalid_application_ref.rs +++ b/src/transpiler/errors/invalid_application_ref.rs @@ -42,7 +42,7 @@ impl Check for InvalidApplicationRef { applications.iter().for_each(|a| { if !refs.contains(a) { errors.push(format!( - "Invalid application -> {}; Ref `{}` does not exist ", + "Invalid application -> {}; Ref `{}` does not exist", a, a )); } @@ -65,7 +65,12 @@ mod tests { let transpiler = Fslt::program(sample_program("errors/invalid-application-ref.fsl")); let errors = InvalidApplicationRef {}.inspect(&transpiler.out()); - assert_that!(errors.is_empty(), is(equal_to(false))); + assert_that!( + errors.first().expect("failed to get first error"), + is(equal_to( + "Invalid application -> \"x\"; Ref `\"x\"` does not exist" + )) + ); Ok(()) } }