mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +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 result = func(&input);
|
||||||
|
|
||||||
let actual_result = if should_pass {
|
let actual_result = if should_pass {
|
||||||
eprintln!("The source code for this test did not successfully parse!\n");
|
result.expect("The source code for this test did not successfully parse!")
|
||||||
|
|
||||||
result.unwrap()
|
|
||||||
} else {
|
} else {
|
||||||
eprintln!(
|
result.expect_err(
|
||||||
"The source code for this test successfully parsed, but it was not expected to!\n"
|
"The source code for this test successfully parsed, but it was not expected to!",
|
||||||
);
|
)
|
||||||
|
|
||||||
result.unwrap_err()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if std::env::var("ROC_PARSER_SNAPSHOT_TEST_OVERWRITE").is_ok() {
|
if std::env::var("ROC_PARSER_SNAPSHOT_TEST_OVERWRITE").is_ok() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue