Skip to content

Commit d1d1026

Browse files
authored
Merge branch 'main' into patch-1
2 parents 306ba74 + c8388ef commit d1d1026

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

packages/typegpu/tests/unplugin/autoname.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,4 +273,21 @@ describe('autonaming', () => {
273273

274274
expect(getName(myController.myBuffer)).toBe('myBuffer');
275275
});
276+
277+
it('autonames functions with illegal WGSL characters', () => {
278+
function $hello() {
279+
'use gpu';
280+
return d.vec3f(1, 0, 0);
281+
}
282+
283+
const names = tgpu['~unstable'].namespace();
284+
285+
// Letting the function's definition be generated
286+
tgpu.resolve([$hello], { names });
287+
288+
// Generating just the name
289+
expect(
290+
tgpu.resolve({ template: '$hello()', externals: { $hello }, names }),
291+
).toMatchInlineSnapshot(`"hello()"`);
292+
});
276293
});

0 commit comments

Comments
 (0)