export const description = ` Test for shader uniformity code snippet generation. `; import { makeTestGroup } from '../common/framework/test_group.js'; import { specToCode } from '../webgpu/shader/validation/uniformity/snippet.js'; import { UnitTest } from './unit_test.js'; class F extends UnitTest { test(spec: string, expect: string): void { const got = specToCode(spec); this.expect( expect === got, ` expected: ${expect} got: ${got}` ); } } export const g = makeTestGroup(F); g.test('strings').fn(t => { t.test( 'loop-end', ` loop { } ` ), t.test( 'loop-cond-break-op', ` loop { if {break;} } ` ), t.test( 'for-unif-always-return-op', ` for (;;) { return; } ` ), t.test( 'loop-op-continuing-cond-break', ` loop { continuing { break if ; } } ` ), t.test( // This is the case suggested in https://github.com/gpuweb/cts/pull/4477#issuecomment-3408419425 'loop-always-return-continuing-cond-break-end-op', ` loop { return; continuing { break if ; } } ` ); });