Skip to content

Commit 295ed85

Browse files
committed
Made functionNode test case 'user_' voodoo resistant
1 parent ddce018 commit 295ed85

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

test/html/test-all.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<title>GPU.JS : Nested Function</title>
5+
<title>GPU.JS : Test All</title>
66
<link rel="stylesheet" href="../lib/qunit-1.20.0.css">
77

88
<!-- gpu.js scripts -->
@@ -19,6 +19,7 @@
1919
<div id="qunit-fixture"></div>
2020
<script src="../lib/qunit-1.20.0.js"></script>
2121

22+
<!-- features -->
2223
<script src="../src/features/function_return.js"></script>
2324
<script src="../src/features/sum_AB.js"></script>
2425
<script src="../src/features/mult_AB.js"></script>
@@ -27,5 +28,9 @@
2728
<script src="../src/features/addCustomFunction.js"></script>
2829
<script src="../src/features/nestedFunction.js"></script>
2930

31+
<!-- internal -->
32+
<script src="../src/internal/functionNode_test.js"></script>
33+
<script src="../src/internal/functionBuilder_test.js"></script>
34+
3035
</body>
3136
</html>

test/src/internal/functionNode_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ QUnit.test( "Math.round implementation: A function with arguments", function( as
6969
assert.notEqual( node.getJS_AST(), null, "AST fetch check" );
7070

7171
assert.equal(
72-
node.getWebglFunctionString().replace(/\s+/g,' '),
72+
node.getWebglFunctionString().replace(/\s+/g,' ').replace(/user_/g,''),
7373
"float round(float a) { return floor(a+0.5); }",
7474
"webgl function conversion check"
7575
);
@@ -92,7 +92,7 @@ QUnit.test( "Two arguments test", function( assert ) {
9292
assert.notEqual( node.getJS_AST(), null, "AST fetch check" );
9393

9494
assert.equal(
95-
node.getWebglFunctionString().replace(/\s+/g,' '),
95+
node.getWebglFunctionString().replace(/\s+/g,' ').replace(/user_/g,''),
9696
"float add_together(float a, float b) { return a+b; }",
9797
"webgl function conversion check"
9898
);

0 commit comments

Comments
 (0)