From 2b36caa82d415304112aca936b59182e513af08d Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Thu, 26 Oct 2023 14:58:26 -0700 Subject: [PATCH] wgsl-errors: Reverse "old" and "new" sides of diff output. 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. --- naga/tests/wgsl-errors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/naga/tests/wgsl-errors.rs b/naga/tests/wgsl-errors.rs index 10dcd54062..e32bd0baa8 100644 --- a/naga/tests/wgsl-errors.rs +++ b/naga/tests/wgsl-errors.rs @@ -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}"),