aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/switch.moon
diff options
context:
space:
mode:
Diffstat (limited to 'spec/inputs/switch.moon')
-rw-r--r--spec/inputs/switch.moon64
1 files changed, 64 insertions, 0 deletions
diff --git a/spec/inputs/switch.moon b/spec/inputs/switch.moon
new file mode 100644
index 0000000..3bc179b
--- /dev/null
+++ b/spec/inputs/switch.moon
@@ -0,0 +1,64 @@
1
2switch value
3 when "cool"
4 print "hello world"
5
6
7switch value
8 when "cool"
9 print "hello world"
10 else
11 print "okay rad"
12
13
14switch value
15 when "cool"
16 print "hello world"
17 when "yeah"
18 [[FFFF]] + [[MMMM]]
19 when 2323 + 32434
20 print "okay"
21 else
22 print "okay rad"
23
24out = switch value
25 when "cool" then print "hello world"
26 else print "okay rad"
27
28out = switch value
29 when "cool" then xxxx
30 when "umm" then 34340
31 else error "this failed big time"
32
33with something
34 switch \value!
35 when .okay
36 "world"
37 else
38 "yesh"
39
40fix this
41call_func switch something
42 when 1 then "yes"
43 else "no"
44
45--
46
47switch hi
48 when hello or world
49 greene
50
51--
52
53switch hi
54 when "one", "two"
55 print "cool"
56 when "dad"
57 no
58
59switch hi
60 when 3+1, hello!, (-> 4)!
61 yello
62 else
63 print "cool"
64