From 8333c5629eef4c1254aa6cde43046ee730fe3701 Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Wed, 13 Nov 2024 19:13:13 -0500 Subject: [PATCH] fix(diagnostic): expect success on duplicate validation if severities are the same --- src/webgpu/shader/validation/parse/diagnostic.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/webgpu/shader/validation/parse/diagnostic.spec.ts b/src/webgpu/shader/validation/parse/diagnostic.spec.ts index becf47f40ba4..3cfbf994b615 100644 --- a/src/webgpu/shader/validation/parse/diagnostic.spec.ts +++ b/src/webgpu/shader/validation/parse/diagnostic.spec.ts @@ -163,7 +163,9 @@ g.test('conflicting_directive') g.test('duplicate_attribute_same_location') .specURL('https://gpuweb.github.io/gpuweb/wgsl/#diagnostics') - .desc(`Tests duplicate diagnostics at the same location must be on different rules`) + .desc( + `Tests duplicate diagnostics at the same location must be on different rules unless the severity is the same` + ) .params(u => u .combine('loc', keysOf(kValidLocations)) @@ -181,7 +183,7 @@ g.test('duplicate_attribute_same_location') const d1 = generateDiagnostic('attribute', t.params.s1, rule1); const d2 = generateDiagnostic('attribute', t.params.s2, t.params.same_rule ? rule1 : rule2); const code = `${kValidLocations[t.params.loc](`${d1} ${d2}`)}`; - t.expectCompileResult(!t.params.same_rule, code); + t.expectCompileResult(!t.params.same_rule || t.params.s1 === t.params.s2, code); }); g.test('conflicting_attribute_different_location')