aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/switch.mp
diff options
context:
space:
mode:
Diffstat (limited to 'spec/inputs/switch.mp')
-rw-r--r--spec/inputs/switch.mp64
1 files changed, 64 insertions, 0 deletions
diff --git a/spec/inputs/switch.mp b/spec/inputs/switch.mp
new file mode 100644
index 0000000..ac3dbea
--- /dev/null
+++ b/spec/inputs/switch.mp
@@ -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