From b2bb9dcd652b83c52bc3f7828fb14f52c77aa8a8 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Sat, 26 Feb 2022 13:32:47 -0800 Subject: [PATCH] improve parser snapshot test error messages --- compiler/parse/tests/test_parse.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/compiler/parse/tests/test_parse.rs b/compiler/parse/tests/test_parse.rs index 544b48fafe..a9cebdbd10 100644 --- a/compiler/parse/tests/test_parse.rs +++ b/compiler/parse/tests/test_parse.rs @@ -291,15 +291,11 @@ mod test_parse { let result = func(&input); let actual_result = if should_pass { - eprintln!("The source code for this test did not successfully parse!\n"); - - result.unwrap() + result.expect("The source code for this test did not successfully parse!") } else { - eprintln!( - "The source code for this test successfully parsed, but it was not expected to!\n" - ); - - result.unwrap_err() + result.expect_err( + "The source code for this test successfully parsed, but it was not expected to!", + ) }; if std::env::var("ROC_PARSER_SNAPSHOT_TEST_OVERWRITE").is_ok() {