Skip to content

Commit c007f4b

Browse files
committed
test(extra): adjust pickers.commands() test after Nightly changes
1 parent b6e058c commit c007f4b

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

tests/screenshots/tests-test_extra.lua---pickers---commands()---respects-user-commands

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
14|│ keepscript = false, │
1616
15|│ name = "MyCommand", │
1717
16|│ nargs = "0", │
18-
17|│ preview = false,
19-
18|│ register = false,
20-
19|│ script_id = -10
21-
20|│}
18+
17|│ register = false, │
19+
18|│ script_id = -10
20+
19|│}
21+
20|│
2222
21|│ │
2323
22|│ │
2424
23|│ │
25-
24|└ Commands ─────────────────────────── 1|2|583
25+
24|└ Commands ─────────────────────────── 1|2|585
2626
25|
2727

2828
--|---------|---------|---------|---------|---------|---------|---------|-----
@@ -45,7 +45,7 @@
4545
17|244444444444444444444444444444444444444444444442111111111111111111111111111
4646
18|244444444444444444444444444444444444444444444442111111111111111111111111111
4747
19|244444444444444444444444444444444444444444444442111111111111111111111111111
48-
20|244444444444444444444444444444444444444444444442111111111111111111111111111
48+
20|255555555555555555555555555555555555555555555552111111111111111111111111111
4949
21|255555555555555555555555555555555555555555555552111111111111111111111111111
5050
22|255555555555555555555555555555555555555555555552111111111111111111111111111
5151
23|255555555555555555555555555555555555555555555552111111111111111111111111111

tests/screenshots/tests-test_extra.lua---pickers---commands()---respects-user-commands-002

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
14|│ keepscript = false, │
1616
15|│ name = "MyCommandBuf", │
1717
16|│ nargs = "*", │
18-
17|│ preview = false,
19-
18|│ register = false,
20-
19|│ script_id = -10
21-
20|│}
18+
17|│ register = false, │
19+
18|│ script_id = -10
20+
19|│}
21+
20|│
2222
21|│ │
2323
22|│ │
2424
23|│ │
25-
24|└ Commands ─────────────────────────── 2|2|583
25+
24|└ Commands ─────────────────────────── 2|2|585
2626
25|
2727

2828
--|---------|---------|---------|---------|---------|---------|---------|-----
@@ -45,7 +45,7 @@
4545
17|244444444444444444444444444444444444444444444442111111111111111111111111111
4646
18|244444444444444444444444444444444444444444444442111111111111111111111111111
4747
19|244444444444444444444444444444444444444444444442111111111111111111111111111
48-
20|244444444444444444444444444444444444444444444442111111111111111111111111111
48+
20|255555555555555555555555555555555555555555555552111111111111111111111111111
4949
21|255555555555555555555555555555555555555555555552111111111111111111111111111
5050
22|255555555555555555555555555555555555555555555552111111111111111111111111111
5151
23|255555555555555555555555555555555555555555555552111111111111111111111111111

tests/test_extra.lua

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,13 @@ T['pickers']['commands()']['works'] = function()
11261126
end
11271127

11281128
T['pickers']['commands()']['respects user commands'] = function()
1129+
local expect_screenshot = function(...)
1130+
-- Screenshots are generated for Neovim>=0.12, since the output structure
1131+
-- of `nvim_get_commands()` has changed
1132+
if child.fn.has('nvim-0.12') == 0 then return end
1133+
child.expect_screenshot(...)
1134+
end
1135+
11291136
child.set_size(25, 75)
11301137
child.cmd('command -nargs=0 MyCommand lua _G.my_command = true')
11311138
child.cmd('command -nargs=* -buffer MyCommandBuf lua _G.my_command_buf = true')
@@ -1137,9 +1144,9 @@ T['pickers']['commands()']['respects user commands'] = function()
11371144

11381145
-- Should have proper preview with data
11391146
type_keys('<Tab>')
1140-
child.expect_screenshot({ ignore_text = { 24 } })
1147+
expect_screenshot({ ignore_text = { 24 } })
11411148
type_keys('<C-n>')
1142-
child.expect_screenshot({ ignore_text = { 24 } })
1149+
expect_screenshot({ ignore_text = { 24 } })
11431150

11441151
-- Should on choose execute command if it is without arguments
11451152
type_keys('<C-p>', '<CR>')

0 commit comments

Comments
 (0)