Skip to content

Commit 547bc8b

Browse files
committed
Add unit test for anonymous function modify hook
1 parent aa4de7f commit 547bc8b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/unit/webgl/p5.Shader.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ suite('p5.Shader', function() {
324324
expect(modified.fragSrc()).not.to.match(/#define AUGMENTED_HOOK_getVertexColor/);
325325
});
326326

327+
test('anonymous function shaderModifier does not throw when parsed', function() {
328+
const callModify = () => myShader.modify(function() {});
329+
expect(callModify).not.toThrowError();
330+
});
331+
327332
test('filled hooks do have an AUGMENTED_HOOK define', function() {
328333
const modified = myShader.modify({
329334
'vec4 getVertexColor': `(vec4 c) {

0 commit comments

Comments
 (0)