aboutsummaryrefslogtreecommitdiffstats
path: root/tests/conditionals.bad
diff options
context:
space:
mode:
Diffstat (limited to 'tests/conditionals.bad')
-rw-r--r--tests/conditionals.bad19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/conditionals.bad b/tests/conditionals.bad
new file mode 100644
index 0000000..45e1bd2
--- /dev/null
+++ b/tests/conditionals.bad
@@ -0,0 +1,19 @@
1; Basic if expressions.
2if true "hello"
3
4; These can produce values and the result bound to a name.
5let a = if (2 + 2 >= 4) 42
6
7; We support a single if expression.
8let b = if 0xff == 255 "hello" else "world"
9
10; ... but these can compound on each other
11if 1 < 2 6
12else if 1 > 2 7
13else 8
14
15; A block is an expression, and if raise the scope level regardless if a block
16; is used or not.
17if true != false {
18 let a = "yo"
19}