diff options
author | Li Jin <dragon-fly@qq.com> | 2025-01-29 14:19:15 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2025-01-29 14:19:15 +0800 |
commit | c26aae8ec7074df49c56f8459af0d5563b46d04d (patch) | |
tree | 57a4ef9896d78051bac0efea2ff76b955bd50997 /spec | |
parent | 8a771320fa37d6069a1ef4a9ac30ac6243149e26 (diff) | |
download | yuescript-c26aae8ec7074df49c56f8459af0d5563b46d04d.tar.gz yuescript-c26aae8ec7074df49c56f8459af0d5563b46d04d.tar.bz2 yuescript-c26aae8ec7074df49c56f8459af0d5563b46d04d.zip |
Updated spec and docs.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/inputs/in_expression.yue | 14 | ||||
-rw-r--r-- | spec/outputs/in_expression.lua | 13 |
2 files changed, 27 insertions, 0 deletions
diff --git a/spec/inputs/in_expression.yue b/spec/inputs/in_expression.yue index e854083..0393881 100644 --- a/spec/inputs/in_expression.yue +++ b/spec/inputs/in_expression.yue | |||
@@ -75,5 +75,19 @@ do | |||
75 | print a in [] | 75 | print a in [] |
76 | a = 1 | 76 | a = 1 |
77 | print a in {} | 77 | print a in {} |
78 | |||
79 | do | ||
80 | a = 1 | ||
81 | print a in [1, 2, 1] | ||
82 | |||
83 | do | ||
84 | a = -1 | ||
85 | print a in [-1, 11, 2, -1, 0, -1] | ||
86 | |||
87 | do | ||
88 | a = 1 | ||
89 | b = 1 | ||
90 | print a in [b, 10, b] | ||
91 | |||
78 | nil | 92 | nil |
79 | 93 | ||
diff --git a/spec/outputs/in_expression.lua b/spec/outputs/in_expression.lua index 3ccab0c..6fbbf91 100644 --- a/spec/outputs/in_expression.lua +++ b/spec/outputs/in_expression.lua | |||
@@ -213,4 +213,17 @@ do | |||
213 | local a = 1 | 213 | local a = 1 |
214 | print((false)) | 214 | print((false)) |
215 | end | 215 | end |
216 | do | ||
217 | local a = 1 | ||
218 | print((1 == a or 2 == a or 1 == a)) | ||
219 | end | ||
220 | do | ||
221 | local a = -1 | ||
222 | print((-1 == a or 11 == a or 2 == a or -1 == a or 0 == a or -1 == a)) | ||
223 | end | ||
224 | do | ||
225 | local a = 1 | ||
226 | local b = 1 | ||
227 | print((b == a or 10 == a or b == a)) | ||
228 | end | ||
216 | return nil | 229 | return nil |