Skip to content

Commit

Permalink
Adds dynamic constant test case
Browse files Browse the repository at this point in the history
  • Loading branch information
JujuAdams authored and katsaii committed Sep 17, 2023
1 parent ff061e8 commit b7a14ae
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -426,4 +426,18 @@ test_add_force(function () : Test(
var _func = engine.compileGML(asg);
var result = _func();
assertEq("good", result);
});

test_add_force(function () : Test(
"dynamic-constants"
) constructor {
var engine = new CatspeakEnvironment();
engine.getInterface().exposeDynamicConstant("room_width", function() { return room_width; });
engine.getInterface().exposeFunction("room_width_function", function() { return room_width; });
var asg = engine.parseString(@'
return (room_width == room_width_function());
');
var _func = engine.compileGML(asg);
var result = _func();
assertEq(true, result);
});

0 comments on commit b7a14ae

Please # to comment.