mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
improve parser snapshot test error messages
This commit is contained in:
parent
333234aad9
commit
b2bb9dcd65
1 changed files with 4 additions and 8 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue