diff options
Diffstat (limited to 'dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/bool_logical.spec.ts')
-rw-r--r-- | dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/bool_logical.spec.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/bool_logical.spec.ts b/dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/bool_logical.spec.ts new file mode 100644 index 0000000000..01eaaab43a --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/bool_logical.spec.ts @@ -0,0 +1,33 @@ +export const description = ` +Execution Tests for the boolean unary logical expression operations +`; + +import { makeTestGroup } from '../../../../../common/framework/test_group.js'; +import { GPUTest } from '../../../../gpu_test.js'; +import { bool, TypeBool } from '../../../../util/conversion.js'; +import { allInputSources, run } from '../expression.js'; + +import { unary } from './unary.js'; + +export const g = makeTestGroup(GPUTest); + +g.test('negation') + .specURL('https://www.w3.org/TR/WGSL/#logical-expr') + .desc( + ` +Expression: !e + +Logical negation. The result is true when e is false and false when e is true. Component-wise when T is a vector. +` + ) + .params(u => + u.combine('inputSource', allInputSources).combine('vectorize', [undefined, 2, 3, 4] as const) + ) + .fn(async t => { + const cases = [ + { input: bool(true), expected: bool(false) }, + { input: bool(false), expected: bool(true) }, + ]; + + await run(t, unary('!'), [TypeBool], TypeBool, t.params, cases); + }); |