diff options
Diffstat (limited to 'tests/logic-shortcircuit.bad')
-rw-r--r-- | tests/logic-shortcircuit.bad | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/logic-shortcircuit.bad b/tests/logic-shortcircuit.bad new file mode 100644 index 0000000..06c8938 --- /dev/null +++ b/tests/logic-shortcircuit.bad | |||
@@ -0,0 +1,16 @@ | |||
1 | fun ret_true() -> Bool { | ||
2 | print("ret_true ") | ||
3 | true | ||
4 | } | ||
5 | |||
6 | fun ret_false() -> Bool { | ||
7 | print("ret_false ") | ||
8 | false | ||
9 | } | ||
10 | |||
11 | println("test1 and x 2: " ret_true() and ret_false() and ret_true()) | ||
12 | println("test2 and x 2: " ret_true() and ret_true() and ret_true()) | ||
13 | println("test3 and x 2: " ret_false() and ret_true() and ret_true()) | ||
14 | println("test4 or x 2: " ret_false() or ret_true() or ret_false()) | ||
15 | println("test5 or x 2: " ret_true() or ret_true() or ret_false()) | ||
16 | println("test6: and/or: " ret_true() and (ret_true() or ret_false())) | ||