diff options
author | Calvin Bochulak <calvin.bochulak@gmail.com> | 2024-03-23 15:46:54 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-23 16:46:54 -0500 |
commit | ca6dbf3558cec83f1d42a1e5f670c40c5893554e (patch) | |
tree | 0a2a0cb5d4e2f1e498db062b5c5b20c319e32f86 /test/functional/lua/iter_spec.lua | |
parent | 3d9c028a4ce1557af7f7269968db5dd0c480f270 (diff) | |
download | rneovim-ca6dbf3558cec83f1d42a1e5f670c40c5893554e.tar.gz rneovim-ca6dbf3558cec83f1d42a1e5f670c40c5893554e.tar.bz2 rneovim-ca6dbf3558cec83f1d42a1e5f670c40c5893554e.zip |
fix(vim.iter): use correct cmp function when truncating tail in `take` (#27998)
Diffstat (limited to 'test/functional/lua/iter_spec.lua')
-rw-r--r-- | test/functional/lua/iter_spec.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/functional/lua/iter_spec.lua b/test/functional/lua/iter_spec.lua index 8d6cf1264b..6d8a37f022 100644 --- a/test/functional/lua/iter_spec.lua +++ b/test/functional/lua/iter_spec.lua @@ -249,6 +249,12 @@ describe('vim.iter', function() do local t = { 4, 3, 2, 1 } + eq({ 1, 2, 3 }, vim.iter(t):rev():take(3):totable()) + eq({ 2, 3, 4 }, vim.iter(t):take(3):rev():totable()) + end + + do + local t = { 4, 3, 2, 1 } local it = vim.iter(t) eq({ 4, 3 }, it:take(2):totable()) -- tail is already set from the previous take() |