1 load("./driver/driver.js");
7 function testConditionalBasic(x
) {
12 testConditionalBasic(false);
13 checkBasicBlock(testConditionalBasic
, "x", ShouldHaveExecuted
);
14 checkBasicBlock(testConditionalBasic
, "20", ShouldHaveExecuted
);
15 checkBasicBlock(testConditionalBasic
, "10", ShouldNotHaveExecuted
);
17 testConditionalBasic(true);
18 checkBasicBlock(testConditionalBasic
, "10", ShouldHaveExecuted
);
21 function testConditionalFunctionCall(x
, y
) {
26 testConditionalFunctionCall(false, false);
27 checkBasicBlock(testConditionalFunctionCall
, "x", ShouldHaveExecuted
);
28 checkBasicBlock(testConditionalFunctionCall
, "? y", ShouldHaveExecuted
);
29 checkBasicBlock(testConditionalFunctionCall
, "bar", ShouldHaveExecuted
);
30 checkBasicBlock(testConditionalFunctionCall
, ": bar", ShouldHaveExecuted
);
31 checkBasicBlock(testConditionalFunctionCall
, "y", ShouldNotHaveExecuted
);
32 checkBasicBlock(testConditionalFunctionCall
, "? foo", ShouldNotHaveExecuted
);
33 checkBasicBlock(testConditionalFunctionCall
, "foo", ShouldNotHaveExecuted
);
34 checkBasicBlock(testConditionalFunctionCall
, "baz", ShouldNotHaveExecuted
);
36 testConditionalFunctionCall(true, false);
37 checkBasicBlock(testConditionalFunctionCall
, "y", ShouldHaveExecuted
);
38 checkBasicBlock(testConditionalFunctionCall
, "? foo", ShouldHaveExecuted
);
39 checkBasicBlock(testConditionalFunctionCall
, ": baz", ShouldHaveExecuted
);
40 checkBasicBlock(testConditionalFunctionCall
, "baz", ShouldHaveExecuted
);
41 checkBasicBlock(testConditionalFunctionCall
, "foo", ShouldNotHaveExecuted
);
43 testConditionalFunctionCall(true, true);
44 checkBasicBlock(testConditionalFunctionCall
, "foo", ShouldHaveExecuted
);