Skip to content

Commit

Permalink
feat: rewrite result mismatch error
Browse files Browse the repository at this point in the history
Co-authored-by: warren2k <[email protected]>
  • Loading branch information
mightyiam and warren2k committed Jun 9, 2024
1 parent 7696f4f commit b2b0190
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
14 changes: 12 additions & 2 deletions src/app/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,18 @@ impl State {
if result != expected_result.as_str() {
anyhow::bail!(indoc::formatdoc! {"
{id}
actual (sanitized): {result}
expected : {expected_result}"
Actual:
```
{result}
```
Expected:
```
{expected_result}
```"
})
}

Expand Down
18 changes: 14 additions & 4 deletions tests/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,21 @@ fn result_mismatch() {

let file_path = file.path().to_str().unwrap();

eelco.assert().failure().stderr(formatdoc! {r#"
eelco.assert().failure().stderr(formatdoc! {"
Error: {file_path}:1
actual (sanitized): 2
expected : 3
"#});
Actual:
```
2
```
Expected:
```
3
```
"});
});
}

Expand Down

0 comments on commit b2b0190

Please sign in to comment.