test expects for variables and expressions

This commit is contained in:
Folkert 2022-12-09 00:04:43 +01:00
parent 4b9e64fd7d
commit 9c72eb5b93
No known key found for this signature in database
GPG Key ID: 1F17F6FFD112B97C
2 changed files with 9 additions and 1 deletions

View File

@ -310,6 +310,9 @@ mod cli_run {
actual = format!("{}passed in <ignored for test> ms.", before_first_digit);
}
let self_path = file.display().to_string();
actual = actual.replace(&self_path, "<ignored for tests>");
if !actual.ends_with(expected_ending) {
panic!(
"expected output to end with:\n{}\nbut instead got:\n{}\n stderr was:\n{}",
@ -573,6 +576,9 @@ mod cli_run {
x : Num *
x = 42
[<ignored for tests> 15:9] 42
[<ignored for tests> 16:9] "Fjoer en ferdjer frieten oan dyn geve lea"
Program finished!
"#
),
UseValgrind::Yes,

View File

@ -12,4 +12,6 @@ expect
main =
x = 42
expect x != x
"Program finished!"
dbg x
dbg "Fjoer en ferdjer frieten oan dyn geve lea"
"Program finished!\n"