Skip to content

Commit 17ba4a5

Browse files
abeldekatechasnovski
authored andcommitted
fix(pick): review, less verbose test_files
1 parent 951a311 commit 17ba4a5

File tree

2 files changed

+4
-50
lines changed

2 files changed

+4
-50
lines changed

tests/screenshots/tests-test_files.lua---Default-explorer---does-not-crash-on-external-`vim.api.nvim_set_current_win`-002

Lines changed: 0 additions & 33 deletions
This file was deleted.

tests/test_files.lua

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5741,50 +5741,37 @@ T['Default explorer']['works in `:edit .`'] = function()
57415741
end
57425742

57435743
T['Default explorer']['deletes directory buffer if already visited(no alternate)'] = function()
5744-
-- Starting with empty buffer having id 1, open and close the explorer
5744+
-- Starting with empty buffer having id 1
57455745
child.cmd('edit ' .. test_dir_path)
57465746
close()
57475747

5748-
-- There should only be 1 buffer after closing the explorer
57495748
local bufs = child.api.nvim_list_bufs()
57505749
eq(#bufs, 1)
57515750

5752-
-- Assert that buffer with id 1 has been deleted, otherwise it would be for directory test_dir_path
5751+
-- Assert that buffer with id 1 has been deleted, otherwise it would be named to directory test_dir_path
57535752
local is_still_one = bufs[1] == 1
57545753
eq(is_still_one, false)
57555754
end
57565755

57575756
T['Default explorer']['deletes directory buffer if already visited'] = function()
5758-
-- Starting with listed buffer having id 1, open and close the explorer
5757+
-- Starting with listed buffer having id 1
57595758
child.cmd('edit ' .. test_file_path)
57605759
child.cmd('edit ' .. test_dir_path)
57615760
close()
57625761

5763-
-- There should only be 1 buffer after closing the explorer
57645762
local bufs = child.api.nvim_list_bufs()
57655763
eq(#bufs, 1)
5766-
5767-
-- Assert that the buffer id is still 1
5768-
local bufid = bufs[1]
5769-
eq(bufid, 1)
5764+
eq(bufs[1], 1)
57705765
end
57715766

57725767
T['Default explorer']['does not crash on external `vim.api.nvim_set_current_win`'] = function()
5773-
-- BufEnter Autocommands for "*": Vim(append):Lua callback : Invalid buffer id: 2
5774-
57755768
child.cmd('edit ' .. test_file_path)
57765769
child.cmd('edit ' .. test_dir_path)
5777-
5778-
-- Mimic MiniPick when stopping the picker(H.picker_stop -> H.set_curwin)
57795770
child.lua([[
57805771
local win_id = vim.api.nvim_list_wins()[1] -- win id 1000
57815772
vim.api.nvim_set_current_win(win_id)
57825773
]])
5783-
57845774
child.expect_screenshot()
5785-
close()
5786-
child.expect_screenshot()
5787-
eq(#child.api.nvim_list_bufs(), 1)
57885775
end
57895776

57905777
T['Default explorer']['works in `:vsplit .`'] = function()

0 commit comments

Comments
 (0)