diff options
author | Li Jin <dragon-fly@qq.com> | 2022-07-27 11:39:50 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2022-07-27 11:39:50 +0800 |
commit | 8df3b854939a63b14aab3fd4688b0caea3daf1dc (patch) | |
tree | 5c142c53bd1f60ede9603f9ba05be731bad61b60 /spec/inputs/test/loops_spec.yue | |
parent | 0f5bdeaeba0f04e49c47f4a2be55b14185a7dfdd (diff) | |
download | yuescript-8df3b854939a63b14aab3fd4688b0caea3daf1dc.tar.gz yuescript-8df3b854939a63b14aab3fd4688b0caea3daf1dc.tar.bz2 yuescript-8df3b854939a63b14aab3fd4688b0caea3daf1dc.zip |
adding test cases.
Diffstat (limited to 'spec/inputs/test/loops_spec.yue')
-rw-r--r-- | spec/inputs/test/loops_spec.yue | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/spec/inputs/test/loops_spec.yue b/spec/inputs/test/loops_spec.yue index 68b5f97..16531ef 100644 --- a/spec/inputs/test/loops_spec.yue +++ b/spec/inputs/test/loops_spec.yue | |||
@@ -1,9 +1,8 @@ | |||
1 | |||
2 | describe "loops", -> | 1 | describe "loops", -> |
3 | it "should continue", -> | 2 | it "should continue", -> |
4 | input = {1,2,3,4,5,6} | 3 | input = {1,2,3,4,5,6} |
5 | output = for x in *input | 4 | output = for x in *input |
6 | continue if x % 2 == 1 | 5 | continue if x % 2 == 1 |
7 | x | 6 | x |
8 | 7 | ||
9 | assert.same output, { 2,4,6 } | 8 | assert.same output, { 2,4,6 } |