aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/switch.lua
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2021-10-12 10:04:44 +0800
committerLi Jin <dragon-fly@qq.com>2021-10-12 10:04:44 +0800
commit60a979e224f26117f5be82bfca757a2483cef0fd (patch)
tree7c6af44f6dcada1f23979b820ba830251997b161 /spec/outputs/switch.lua
parenta19b242cbaf53721b20a3163dd06f43e9ef2b487 (diff)
downloadyuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.gz
yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.bz2
yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.zip
fix test.
Diffstat (limited to 'spec/outputs/switch.lua')
-rw-r--r--spec/outputs/switch.lua71
1 files changed, 71 insertions, 0 deletions
diff --git a/spec/outputs/switch.lua b/spec/outputs/switch.lua
new file mode 100644
index 0000000..1c8839f
--- /dev/null
+++ b/spec/outputs/switch.lua
@@ -0,0 +1,71 @@
1local _exp_0 = value
2if "cool" == _exp_0 then
3 print("hello world")
4end
5local _exp_1 = value
6if "cool" == _exp_1 then
7 print("hello world")
8else
9 print("okay rad")
10end
11local _exp_2 = value
12if "cool" == _exp_2 then
13 print("hello world")
14elseif "yeah" == _exp_2 then
15 local _ = [[FFFF]] + [[MMMM]]
16elseif (2323 + 32434) == _exp_2 then
17 print("okay")
18else
19 print("okay rad")
20end
21local out
22local _exp_3 = value
23if "cool" == _exp_3 then
24 out = print("hello world")
25else
26 out = print("okay rad")
27end
28local _exp_4 = value
29if "cool" == _exp_4 then
30 out = xxxx
31elseif "umm" == _exp_4 then
32 out = 34340
33else
34 out = error("this failed big time")
35end
36do
37 local _with_0 = something
38 local _exp_5 = _with_0:value()
39 if _with_0.okay == _exp_5 then
40 local _ = "world"
41 else
42 local _ = "yesh"
43 end
44end
45fix(this)
46call_func((function()
47 local _exp_5 = something
48 if 1 == _exp_5 then
49 return "yes"
50 else
51 return "no"
52 end
53end)())
54local _exp_5 = hi
55if (hello or world) == _exp_5 then
56 local _ = greene
57end
58local _exp_6 = hi
59if "one" == _exp_6 or "two" == _exp_6 then
60 print("cool")
61elseif "dad" == _exp_6 then
62 local _ = no
63end
64local _exp_7 = hi
65if (3 + 1) == _exp_7 or hello() == _exp_7 or (function()
66 return 4
67end)() == _exp_7 then
68 return yello
69else
70 return print("cool")
71end