diff options
| author | Barrett Ruth <br@barrettruth.com> | 2026-07-24 16:28:25 -0700 |
|---|---|---|
| committer | Barrett Ruth <br@barrettruth.com> | 2026-07-29 14:32:36 -0500 |
| commit | f82cf8fd596fa173a028bd04035d0465d09f8d48 (patch) | |
| tree | 285441cf49d6c5ad1886934b8be618021c47349e /test/functional/plugin | |
| parent | e63cf571067e8d1777adc354b098dfc91c2ab5de (diff) | |
| download | rneovim-f82cf8fd596fa173a028bd04035d0465d09f8d48.tar.gz rneovim-f82cf8fd596fa173a028bd04035d0465d09f8d48.tar.bz2 rneovim-f82cf8fd596fa173a028bd04035d0465d09f8d48.zip | |
fix(zip): list a valid empty archive as empty
Diffstat (limited to 'test/functional/plugin')
| -rw-r--r-- | test/functional/plugin/zip_spec.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/plugin/zip_spec.lua b/test/functional/plugin/zip_spec.lua index 5ec4329283..f849f19a68 100644 --- a/test/functional/plugin/zip_spec.lua +++ b/test/functional/plugin/zip_spec.lua @@ -283,6 +283,20 @@ describe('nvim.zip', function() eq({ '' }, lines()) end) + it('lists a valid empty archive as empty', function() + local archive = vim.fs.joinpath(root, 'empty.zip') + local file = assert(io.open(archive, 'wb')) + file:write('PK\5\6' .. string.rep('\0', 18)) + file:close() + clear_zip() + + edit(archive) + + eq({ '' }, lines()) + eq('zip', api.nvim_get_option_value('filetype', { buf = 0 })) + eq(true, exec_lua('return vim.b.nvim_zip ~= nil')) + end) + it('treats archive glob characters literally', function() t.skip(t.is_os('win'), 'N/A: Windows filenames cannot contain these characters') local archive = vim.fs.joinpath(root, 'archive::[*?].zip') |