Skip to content

Commit

Permalink
wgsl-errors: Reverse "old" and "new" sides of diff output.
Browse files Browse the repository at this point in the history
When an error snapshot test fails and we generate a diff comparing the
expected output with the actual output, treat the expected output as
the diff "from", and the actual output as the diff "to" - not the
reverse.
  • Loading branch information
jimblandy committed Oct 26, 2023
1 parent ada3cd8 commit 73f7642
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/wgsl-errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn check(input: &str, snapshot: &str) {
.expect_err("expected parser error")
.emit_to_string(input);
if output != snapshot {
for diff in diff::lines(&output, snapshot) {
for diff in diff::lines(snapshot, &output) {
match diff {
diff::Result::Left(l) => println!("-{l}"),
diff::Result::Both(l, _) => println!(" {l}"),
Expand Down

0 comments on commit 73f7642

Please sign in to comment.