diff options
author | Li Jin <dragon-fly@qq.com> | 2022-07-14 17:39:58 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2022-07-14 17:39:58 +0800 |
commit | e4a719344f2d3bf6008d15949baf60fa68420135 (patch) | |
tree | 6cdfccd1bda7df3970136a3a7656eb339f3fb92b /spec/inputs | |
parent | f7b674213bd996016cb94c44ef22736a6cbdf6f3 (diff) | |
download | yuescript-0.13.6.tar.gz yuescript-0.13.6.tar.bz2 yuescript-0.13.6.zip |
add spec.v0.13.6
Diffstat (limited to 'spec/inputs')
-rw-r--r-- | spec/inputs/switch.yue | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/inputs/switch.yue b/spec/inputs/switch.yue index 08330bf..442d15f 100644 --- a/spec/inputs/switch.yue +++ b/spec/inputs/switch.yue | |||
@@ -108,10 +108,20 @@ do | |||
108 | 108 | ||
109 | do | 109 | do |
110 | tb = {} | 110 | tb = {} |
111 | |||
111 | switch tb | 112 | switch tb |
112 | when {:a = 1, :b = 2} | 113 | when {:a = 1, :b = 2} |
113 | print a, b | 114 | print a, b |
114 | 115 | ||
116 | switch tb | ||
117 | when {:a, :b = 2} | ||
118 | print "partially matched", a, b | ||
119 | |||
120 | switch tb | ||
121 | when {:a, :b} | ||
122 | print a, b | ||
123 | else | ||
124 | print "not matched" | ||
115 | do | 125 | do |
116 | tb = x: "abc" | 126 | tb = x: "abc" |
117 | switch tb | 127 | switch tb |