diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-01-28 18:43:14 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-01-28 18:43:14 +0800 |
| commit | dd64edd58fe25ec74ae5958128cf3f74b0692f3b (patch) | |
| tree | 0f2de1df55897e2713977c5a53936757e14b477a /spec/inputs/test/table_append_spec.yue | |
| parent | 7c2a92b82e9808d3c5ea29b47d1c59d663fe984a (diff) | |
| download | yuescript-dd64edd58fe25ec74ae5958128cf3f74b0692f3b.tar.gz yuescript-dd64edd58fe25ec74ae5958128cf3f74b0692f3b.tar.bz2 yuescript-dd64edd58fe25ec74ae5958128cf3f74b0692f3b.zip | |
Fixed compiler issues and added 800+ test cases.
Diffstat (limited to 'spec/inputs/test/table_append_spec.yue')
| -rw-r--r-- | spec/inputs/test/table_append_spec.yue | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/inputs/test/table_append_spec.yue b/spec/inputs/test/table_append_spec.yue index ab3d6d2..51c7873 100644 --- a/spec/inputs/test/table_append_spec.yue +++ b/spec/inputs/test/table_append_spec.yue | |||
| @@ -30,12 +30,12 @@ describe "table append", -> | |||
| 30 | tab[] = ...tb2 | 30 | tab[] = ...tb2 |
| 31 | assert.same tab, {1, 2} | 31 | assert.same tab, {1, 2} |
| 32 | 32 | ||
| 33 | it "should append nil values", -> | 33 | it "should not append nil values", -> |
| 34 | tab = [] | 34 | tab = [] |
| 35 | tab[] = nil | 35 | tab[] = nil |
| 36 | tab[] = "value" | 36 | tab[] = "value" |
| 37 | assert.same tab[1], nil | 37 | assert.same tab[2], nil |
| 38 | assert.same tab[2], "value" | 38 | assert.same tab[1], "value" |
| 39 | 39 | ||
| 40 | it "should work in loop", -> | 40 | it "should work in loop", -> |
| 41 | tab = [] | 41 | tab = [] |
| @@ -73,5 +73,5 @@ describe "table append", -> | |||
| 73 | it "should append function results", -> | 73 | it "should append function results", -> |
| 74 | fn = -> 1, 2, 3 | 74 | fn = -> 1, 2, 3 |
| 75 | tab = [] | 75 | tab = [] |
| 76 | tab[] = fn! | 76 | tab[] = ...[fn!,] |
| 77 | assert.same tab, {1, 2, 3} | 77 | assert.same tab, {1, 2, 3} |
