mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-01-10 06:08:24 -05:00
wgsl-errors: Reverse "old" and "new" sides of diff output. (#4577)
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.
This commit is contained in:
@@ -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}"),
|
||||
|
||||
Reference in New Issue
Block a user