diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2023-12-05 18:35:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-05 18:35:22 -0800 |
commit | 5b40a1c09dda83275784053b325ad16626fc55f2 (patch) | |
tree | d88817c9bc73998318922f37b1057a8e446bf97e /test/functional/lua/iter_spec.lua | |
parent | cc38086039853d53157b30fec41babb148399038 (diff) | |
download | rneovim-5b40a1c09dda83275784053b325ad16626fc55f2.tar.gz rneovim-5b40a1c09dda83275784053b325ad16626fc55f2.tar.bz2 rneovim-5b40a1c09dda83275784053b325ad16626fc55f2.zip |
feat(lua): implement Iter:join() (#26416)
Diffstat (limited to 'test/functional/lua/iter_spec.lua')
-rw-r--r-- | test/functional/lua/iter_spec.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/functional/lua/iter_spec.lua b/test/functional/lua/iter_spec.lua index ffa28e7b11..2d28395c59 100644 --- a/test/functional/lua/iter_spec.lua +++ b/test/functional/lua/iter_spec.lua @@ -91,6 +91,11 @@ describe('vim.iter', function() end end) + it('join()', function() + eq('1, 2, 3', vim.iter({1, 2, 3}):join(', ')) + eq('a|b|c|d', vim.iter(vim.gsplit('a|b|c|d', '|')):join('|')) + end) + it('next()', function() local it = vim.iter({1, 2, 3}):map(function(v) return 2 * v end) eq(2, it:next()) |