diff options
| author | Li Jin <dragon-fly@qq.com> | 2021-10-12 10:04:44 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2021-10-12 10:04:44 +0800 |
| commit | 60a979e224f26117f5be82bfca757a2483cef0fd (patch) | |
| tree | 7c6af44f6dcada1f23979b820ba830251997b161 /spec/outputs/switch.lua | |
| parent | a19b242cbaf53721b20a3163dd06f43e9ef2b487 (diff) | |
| download | yuescript-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.lua | 71 |
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 @@ | |||
| 1 | local _exp_0 = value | ||
| 2 | if "cool" == _exp_0 then | ||
| 3 | print("hello world") | ||
| 4 | end | ||
| 5 | local _exp_1 = value | ||
| 6 | if "cool" == _exp_1 then | ||
| 7 | print("hello world") | ||
| 8 | else | ||
| 9 | print("okay rad") | ||
| 10 | end | ||
| 11 | local _exp_2 = value | ||
| 12 | if "cool" == _exp_2 then | ||
| 13 | print("hello world") | ||
| 14 | elseif "yeah" == _exp_2 then | ||
| 15 | local _ = [[FFFF]] + [[MMMM]] | ||
| 16 | elseif (2323 + 32434) == _exp_2 then | ||
| 17 | print("okay") | ||
| 18 | else | ||
| 19 | print("okay rad") | ||
| 20 | end | ||
| 21 | local out | ||
| 22 | local _exp_3 = value | ||
| 23 | if "cool" == _exp_3 then | ||
| 24 | out = print("hello world") | ||
| 25 | else | ||
| 26 | out = print("okay rad") | ||
| 27 | end | ||
| 28 | local _exp_4 = value | ||
| 29 | if "cool" == _exp_4 then | ||
| 30 | out = xxxx | ||
| 31 | elseif "umm" == _exp_4 then | ||
| 32 | out = 34340 | ||
| 33 | else | ||
| 34 | out = error("this failed big time") | ||
| 35 | end | ||
| 36 | do | ||
| 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 | ||
| 44 | end | ||
| 45 | fix(this) | ||
| 46 | call_func((function() | ||
| 47 | local _exp_5 = something | ||
| 48 | if 1 == _exp_5 then | ||
| 49 | return "yes" | ||
| 50 | else | ||
| 51 | return "no" | ||
| 52 | end | ||
| 53 | end)()) | ||
| 54 | local _exp_5 = hi | ||
| 55 | if (hello or world) == _exp_5 then | ||
| 56 | local _ = greene | ||
| 57 | end | ||
| 58 | local _exp_6 = hi | ||
| 59 | if "one" == _exp_6 or "two" == _exp_6 then | ||
| 60 | print("cool") | ||
| 61 | elseif "dad" == _exp_6 then | ||
| 62 | local _ = no | ||
| 63 | end | ||
| 64 | local _exp_7 = hi | ||
| 65 | if (3 + 1) == _exp_7 or hello() == _exp_7 or (function() | ||
| 66 | return 4 | ||
| 67 | end)() == _exp_7 then | ||
| 68 | return yello | ||
| 69 | else | ||
| 70 | return print("cool") | ||
| 71 | end | ||
