refactor(tvix/eval): use pretty_assertions for tests
This makes for much more readable output especially when long strings are involved. Change-Id: I43dd73a0480535d7181a760788c42883a9b083f8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6229 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
f153a163a6
commit
16e9703f38
3 changed files with 50 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use crate::eval::interpret;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
use test_generator::test_resources;
|
||||
|
||||
|
|
@ -15,9 +16,9 @@ fn eval_okay_test(code_path: &str) {
|
|||
let result_str = format!("{}", result);
|
||||
|
||||
assert_eq!(
|
||||
exp.trim(),
|
||||
result_str,
|
||||
"result value representation (right) must match expectation (left)"
|
||||
exp.trim(),
|
||||
"result value representation (left) must match expectation (right)"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -31,9 +32,9 @@ fn identity(code_path: &str) {
|
|||
let result_str = format!("{}", result);
|
||||
|
||||
assert_eq!(
|
||||
code.trim(),
|
||||
result_str,
|
||||
"result value representation (right) must match expectation (left)"
|
||||
code.trim(),
|
||||
"result value representation (left) must match expectation (right)"
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue