diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bools.toc | 22 | ||||
-rw-r--r-- | tests/bools_expected | 2 |
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/bools.toc b/tests/bools.toc new file mode 100644 index 0000000..b181972 --- /dev/null +++ b/tests/bools.toc @@ -0,0 +1,22 @@ +#include "std/io.toc"; + +foo ::= fn() total := 0{ + if "foo" || (1/0) { + total += 1; + } + if !"foo" && (1/0) { + total += 100; + } + if "foo" || "bar" && 0 { + total += 10; + } + if !"foo" || !"bar" { + total += 1000; + } +} +main ::= fn() { + a := foo(); + b ::= foo(); + puti(a); + puti(b); +} diff --git a/tests/bools_expected b/tests/bools_expected new file mode 100644 index 0000000..47e3206 --- /dev/null +++ b/tests/bools_expected @@ -0,0 +1,2 @@ +11 +11 |