diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-03-20 15:24:32 -0300 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-11-30 10:20:02 +0100 |
| commit | 99093835a557cd04de0c37206debdcd345801199 (patch) | |
| tree | dc8879392e6e80bea1ab626a438d88daa2c09f17 /util_test.lua | |
| parent | 6230265151e1ecf95488f5c9eda1c48c48014d8e (diff) | |
| download | vis-lspc-99093835a557cd04de0c37206debdcd345801199.tar.gz vis-lspc-99093835a557cd04de0c37206debdcd345801199.zip | |
append numbered members when merging
Overriding numbered members is not intuitive.
Merging {1} and {2} should return {1,2} not {2}.
Diffstat (limited to 'util_test.lua')
| -rwxr-xr-x | util_test.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/util_test.lua b/util_test.lua index 661b9f5..63393b1 100755 --- a/util_test.lua +++ b/util_test.lua @@ -57,11 +57,16 @@ function test_table_merge() -- luacheck: ignore 111 util.table.merge(t, t2) lunatest.assert_table(t) - lunatest.assert_len(2, t) + lunatest.assert_len(3, t) + + lunatest.assert_equal(1, t[1]) + lunatest.assert_equal(2, t[2]) + lunatest.assert_equal(3, t[3]) + lunatest.assert_table(t.foo) lunatest.assert_len(2, t.foo) - lunatest.assert_equal(t[1], t2[1]) + lunatest.assert_equal(t[3], t2[1]) lunatest.assert_equal(t[2], 2) lunatest.assert_equal(t.foo.bar.bar, 'bar') |
