refactor(tests): again yet more global highlight definitions

This commit is contained in:
bfredl 2024-08-14 13:42:05 +02:00
parent 9d74dc3ac5
commit ef4c9b136e
9 changed files with 139 additions and 231 deletions

View File

@ -103,9 +103,9 @@ describe('oldtests', function()
it('no ml_get error with TextChanged autocommand and delete', function()
local screen = Screen.new(75, 10)
screen:attach()
screen:set_default_attr_ids({
[1] = { background = Screen.colors.Cyan },
})
screen:add_extra_attr_ids {
[100] = { background = Screen.colors.Cyan1 },
}
exec([[
set noshowcmd noruler scrolloff=0
source test/old/testdir/samples/matchparen.vim
@ -120,9 +120,9 @@ describe('oldtests', function()
} |
const auto &themes = _forPeer->owner().cloudThemes(); |
const auto theme = themes.themeForEmoji(themeEmoji); |
if (!theme) {1:{} |
if (!theme) {100:{} |
return nonCustom; |
{1:^}} |
{100:^}} |
353 fewer lines |
]],
}

View File

@ -259,15 +259,6 @@ describe('autocmd', function()
local screen = Screen.new(50, 10)
screen:attach()
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { background = Screen.colors.LightMagenta },
[3] = {
background = Screen.colors.LightMagenta,
bold = true,
foreground = Screen.colors.Blue1,
},
})
source([[
function! Doit()
@ -292,8 +283,8 @@ describe('autocmd', function()
feed(':enew | doautoall User<cr>')
screen:expect([[
{2:bb }|
{3:~ }|*4
{4:bb }|
{11:~ }|*4
{1:~ }|*4
^:enew | doautoall User |
]])
@ -318,8 +309,8 @@ describe('autocmd', function()
command('let g:had_value = v:null')
feed(':doautoall User<cr>')
screen:expect([[
{2:bb }|
{3:~ }|*4
{4:bb }|
{11:~ }|*4
{1:~ }|*4
^:doautoall User |
]])
@ -343,11 +334,6 @@ describe('autocmd', function()
it('`aucmd_win` cannot be changed into a normal window #13699', function()
local screen = Screen.new(50, 10)
screen:attach()
screen:set_default_attr_ids {
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { reverse = true },
[3] = { bold = true, reverse = true },
}
-- Create specific layout and ensure it's left unchanged.
-- Use vim._with on a hidden buffer so aucmd_win is used.
@ -513,9 +499,6 @@ describe('autocmd', function()
it(':doautocmd does not warn "No matching autocommands" #10689', function()
local screen = Screen.new(32, 3)
screen:attach()
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue1 },
})
feed(':doautocmd User Foo<cr>')
screen:expect {

View File

@ -61,12 +61,6 @@ describe('cmdline autocommands', function()
clear()
local screen = Screen.new(72, 8)
screen:attach()
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[3] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[4] = { bold = true, reverse = true },
})
command("autocmd CmdlineEnter * echoerr 'FAIL'")
command("autocmd CmdlineLeave * echoerr 'very error'")
@ -74,22 +68,22 @@ describe('cmdline autocommands', function()
screen:expect([[
|
{1:~ }|*3
{4: }|
{3: }|
: |
{2:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} |
{9:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} |
:^ |
]])
feed("put ='lorem ipsum'<cr>")
screen:expect([[
|
{4: }|
{3: }|
: |
{2:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} |
{9:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} |
:put ='lorem ipsum' |
{2:CmdlineLeave Autocommands for "*": Vim(echoerr):very error} |
{9:CmdlineLeave Autocommands for "*": Vim(echoerr):very error} |
|
{3:Press ENTER or type command to continue}^ |
{6:Press ENTER or type command to continue}^ |
]])
-- cmdline was still executed
@ -108,11 +102,11 @@ describe('cmdline autocommands', function()
screen:expect([[
|
lorem ipsum |
{4: }|
{3: }|
: |
{2:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} |
{9:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} |
:put ='lorem ipsum' |
{2:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} |
{9:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} |
:put ='lorem ipsum'^ |
]])
@ -120,37 +114,37 @@ describe('cmdline autocommands', function()
screen:expect([[
|
lorem ipsum |
{4: }|
{3: }|
: |
{2:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} |
{9:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} |
:put ='lorem ipsum' |
{2:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} |
{9:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} |
:put ='lorem ipsum^' |
]])
-- edit still works
feed('.')
screen:expect([[
{4: }|
{3: }|
: |
{2:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} |
{9:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} |
:put ='lorem ipsum' |
{2:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} |
{9:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} |
:put ='lorem ipsum.' |
{2:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} |
{9:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} |
:put ='lorem ipsum.^' |
]])
feed('<cr>')
screen:expect([[
:put ='lorem ipsum' |
{2:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} |
{9:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} |
:put ='lorem ipsum.' |
{2:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} |
{9:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} |
:put ='lorem ipsum.' |
{2:CmdlineLeave Autocommands for "*": Vim(echoerr):very error} |
{9:CmdlineLeave Autocommands for "*": Vim(echoerr):very error} |
|
{3:Press ENTER or type command to continue}^ |
{6:Press ENTER or type command to continue}^ |
]])
-- cmdline was still executed

View File

@ -43,11 +43,9 @@ describe(':autocmd', function()
it('should not show group information if interrupted', function()
local screen = Screen.new(50, 6)
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue1 }, -- NonText
[2] = { bold = true, foreground = Screen.colors.SeaGreen }, -- MoreMsg
[3] = { bold = true, foreground = Screen.colors.Magenta }, -- Title
})
screen:add_extra_attr_ids {
[100] = { foreground = Screen.colors.Magenta, bold = true },
}
screen:attach()
exec([[
set more
@ -73,11 +71,11 @@ describe(':autocmd', function()
feed(':autocmd<CR>')
screen:expect([[
:autocmd |
{3:--- Autocommands ---} |
{3:test_1} {3:BufEnter} |
{100:--- Autocommands ---} |
{100:test_1} {100:BufEnter} |
A echo 'A' |
B echo 'B' |
{2:-- More --}^ |
{6:-- More --}^ |
]])
feed('q')
screen:expect([[

View File

@ -510,23 +510,16 @@ describe('v:lua', function()
it('works in func options', function()
local screen = Screen.new(60, 8)
screen:set_default_attr_ids({
[1] = {bold = true, foreground = Screen.colors.Blue1},
[2] = {background = Screen.colors.WebGray},
[3] = {background = Screen.colors.LightMagenta},
[4] = {bold = true},
[5] = {bold = true, foreground = Screen.colors.SeaGreen4},
})
screen:attach()
api.nvim_set_option_value('omnifunc', 'v:lua.mymod.omni', {})
feed('isome st<c-x><c-o>')
screen:expect{grid=[[
some stuff^ |
{1:~ }{2: stuff }{1: }|
{1:~ }{3: steam }{1: }|
{1:~ }{3: strange things }{1: }|
{1:~ }{12: stuff }{1: }|
{1:~ }{4: steam }{1: }|
{1:~ }{4: strange things }{1: }|
{1:~ }|*3
{4:-- Omni completion (^O^N^P) }{5:match 1 of 3} |
{5:-- Omni completion (^O^N^P) }{6:match 1 of 3} |
]]}
api.nvim_set_option_value('operatorfunc', 'v:lua.mymod.noisy', {})
feed('<Esc>g@g@')

View File

@ -18,13 +18,6 @@ describe('thread', function()
clear()
screen = Screen.new(50, 10)
screen:attach()
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { bold = true, reverse = true },
[3] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[5] = { bold = true },
})
end)
it('entry func is executed in protected mode', function()
@ -38,10 +31,10 @@ describe('thread', function()
screen:expect([[
|
{1:~ }|*5
{2: }|
{3:Error in luv thread:} |
{3:[string "<nvim>"]:2: Error in thread entry func} |
{4:Press ENTER or type command to continue}^ |
{3: }|
{9:Error in luv thread:} |
{9:[string "<nvim>"]:2: Error in thread entry func} |
{6:Press ENTER or type command to continue}^ |
]])
feed('<cr>')
assert_alive()
@ -65,10 +58,10 @@ describe('thread', function()
screen:expect([[
|
{1:~ }|*5
{2: }|
{3:Error in luv callback, thread:} |
{3:[string "<nvim>"]:6: Error in thread callback} |
{4:Press ENTER or type command to continue}^ |
{3: }|
{9:Error in luv callback, thread:} |
{9:[string "<nvim>"]:6: Error in thread callback} |
{6:Press ENTER or type command to continue}^ |
]])
feed('<cr>')
assert_alive()
@ -265,13 +258,6 @@ describe('threadpool', function()
it('with invalid return value', function()
local screen = Screen.new(50, 10)
screen:attach()
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { bold = true, reverse = true },
[3] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[5] = { bold = true },
})
exec_lua [[
local work = vim.uv.new_work(function() return {} end, function() end)
@ -281,10 +267,10 @@ describe('threadpool', function()
screen:expect([[
|
{1:~ }|*5
{2: }|
{3:Error in luv thread:} |
{3:Error: thread arg not support type 'table' at 1} |
{4:Press ENTER or type command to continue}^ |
{3: }|
{9:Error in luv thread:} |
{9:Error: thread arg not support type 'table' at 1} |
{6:Press ENTER or type command to continue}^ |
]])
end)

View File

@ -540,12 +540,6 @@ describe('lua stdlib', function()
matches('big failure\nvery async', remove_trace(eval('v:errmsg')))
local screen = Screen.new(60, 5)
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { bold = true, reverse = true },
[3] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
})
screen:attach()
screen:expect {
grid = [[
@ -564,11 +558,11 @@ describe('lua stdlib', function()
]])
screen:expect {
grid = [[
{3:stack traceback:} |
{3: [C]: in function 'nvim_command'} |
{3: [string "<nvim>"]:2: in function <[string "<nvim>"]:}|
{3:1>} |
{4:Press ENTER or type command to continue}^ |
{9:stack traceback:} |
{9: [C]: in function 'nvim_command'} |
{9: [string "<nvim>"]:2: in function <[string "<nvim>"]:}|
{9:1>} |
{6:Press ENTER or type command to continue}^ |
]],
}
end)
@ -1318,12 +1312,6 @@ describe('lua stdlib', function()
end)
local screen = Screen.new(50, 7)
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { bold = true, reverse = true },
[3] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
})
screen:attach()
exec_lua([[
timer = vim.uv.new_timer()
@ -1336,13 +1324,13 @@ describe('lua stdlib', function()
]])
screen:expect {
grid = [[
{3:[string "<nvim>"]:6: E5560: rpcrequest must not be}|
{3: called in a lua loop callback} |
{3:stack traceback:} |
{3: [C]: in function 'rpcrequest'} |
{3: [string "<nvim>"]:6: in function <[string }|
{3:"<nvim>"]:2>} |
{4:Press ENTER or type command to continue}^ |
{9:[string "<nvim>"]:6: E5560: rpcrequest must not be}|
{9: called in a lua loop callback} |
{9:stack traceback:} |
{9: [C]: in function 'rpcrequest'} |
{9: [string "<nvim>"]:6: in function <[string }|
{9:"<nvim>"]:2>} |
{6:Press ENTER or type command to continue}^ |
]],
}
feed('<cr>')
@ -1995,16 +1983,12 @@ describe('lua stdlib', function()
eq({ 1, 5 }, api.nvim_win_get_cursor(0))
local screen = Screen.new(60, 3)
screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue },
[1] = { background = Screen.colors.Yellow },
})
screen:attach()
eq(1, eval('v:hlsearch'))
screen:expect {
grid = [[
{1:foo} {1:^foo} {1:foo} |
{0:~ }|
{10:foo} {10:^foo} {10:foo} |
{1:~ }|
|
]],
}
@ -2013,7 +1997,7 @@ describe('lua stdlib', function()
screen:expect {
grid = [[
foo ^foo foo |
{0:~ }|
{1:~ }|
|
]],
}
@ -2021,8 +2005,8 @@ describe('lua stdlib', function()
eq(1, eval('v:hlsearch'))
screen:expect {
grid = [[
{1:foo} {1:^foo} {1:foo} |
{0:~ }|
{10:foo} {10:^foo} {10:foo} |
{1:~ }|
|
]],
}
@ -3542,15 +3526,11 @@ describe('lua stdlib', function()
it('vim.notify_once', function()
local screen = Screen.new(60, 5)
screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue },
[1] = { foreground = Screen.colors.Red },
})
screen:attach()
screen:expect {
grid = [[
^ |
{0:~ }|*3
{1:~ }|*3
|
]],
}
@ -3558,15 +3538,15 @@ describe('lua stdlib', function()
screen:expect {
grid = [[
^ |
{0:~ }|*3
{1:I'll only tell you this once...} |
{1:~ }|*3
{19:I'll only tell you this once...} |
]],
}
feed('<C-l>')
screen:expect {
grid = [[
^ |
{0:~ }|*3
{1:~ }|*3
|
]],
}
@ -3743,10 +3723,6 @@ describe('lua stdlib', function()
it('updates ruler if cursor moved', function()
-- Fixed for win_execute in vim-patch:8.1.2124, but should've applied to nvim_win_call too!
local screen = Screen.new(30, 5)
screen:set_default_attr_ids {
[1] = { reverse = true },
[2] = { bold = true, reverse = true },
}
screen:attach()
exec_lua [[
_G.api = vim.api
@ -3761,9 +3737,9 @@ describe('lua stdlib', function()
]]
screen:expect [[
19 |
{1:[No Name] [+] 20,1 3%}|
^19 |
{2:[No Name] [+] 20,1 3%}|
^19 |
{3:[No Name] [+] 20,1 3%}|
|
]]
exec_lua [[
@ -3772,9 +3748,9 @@ describe('lua stdlib', function()
]]
screen:expect [[
99 |
{1:[No Name] [+] 100,1 19%}|
{2:[No Name] [+] 100,1 19%}|
^19 |
{2:[No Name] [+] 20,1 3%}|
{3:[No Name] [+] 20,1 3%}|
|
]]
end)
@ -3890,13 +3866,6 @@ describe('lua stdlib', function()
it('vim.lua_omnifunc', function()
local screen = Screen.new(60, 5)
screen:set_default_attr_ids {
[1] = { foreground = Screen.colors.Blue1, bold = true },
[2] = { background = Screen.colors.WebGray },
[3] = { background = Screen.colors.LightMagenta },
[4] = { bold = true },
[5] = { foreground = Screen.colors.SeaGreen, bold = true },
}
screen:attach()
command [[ set omnifunc=v:lua.vim.lua_omnifunc ]]
@ -3906,10 +3875,10 @@ describe('lua stdlib', function()
screen:expect {
grid = [[
vim.inspect^ |
{1:~ }{2: inspect }{1: }|
{1:~ }{3: inspect_pos }{1: }|
{1:~ }{12: inspect }{1: }|
{1:~ }{4: inspect_pos }{1: }|
{1:~ }|
{4:-- Omni completion (^O^N^P) }{5:match 1 of 2} |
{5:-- Omni completion (^O^N^P) }{6:match 1 of 2} |
]],
}
end)

View File

@ -94,12 +94,6 @@ describe('clipboard', function()
before_each(function()
clear()
screen = Screen.new(72, 4)
screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue },
[1] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[2] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[3] = { bold = true, reverse = true },
})
screen:attach()
end)
@ -114,13 +108,13 @@ describe('clipboard', function()
feed('"+yl')
screen:expect([[
^a |
{0:~ }|*2
{1:~ }|*2
clipboard: No provider. Try ":checkhealth" or ":h clipboard". |
]])
feed('"+p')
screen:expect([[
a^a |
{0:~ }|*2
{1:~ }|*2
clipboard: No provider. Try ":checkhealth" or ":h clipboard". |
]])
end)
@ -132,19 +126,19 @@ describe('clipboard', function()
feed('yl')
screen:expect([[
^a |
{0:~ }|*2
{1:~ }|*2
clipboard: No provider. Try ":checkhealth" or ":h clipboard". |
]])
feed(':<CR>')
screen:expect([[
^a |
{0:~ }|*2
{1:~ }|*2
: |
]])
feed('p')
screen:expect([[
a^a |
{0:~ }|*2
{1:~ }|*2
: |
]])
end)
@ -154,7 +148,7 @@ describe('clipboard', function()
feed_command('redir @+> | :silent echo system("cat CONTRIBUTING.md") | redir END')
screen:expect([[
^ |
{0:~ }|*2
{1:~ }|*2
clipboard: No provider. Try ":checkhealth" or ":h clipboard". |
]])
end)
@ -166,8 +160,8 @@ describe('clipboard', function()
grid = [[
{3: }|
clipboard: No provider. Try ":checkhealth" or ":h clipboard". |
{1:E492: Not an editor command: bogus_cmd | redir END} |
{2:Press ENTER or type command to continue}^ |
{9:E492: Not an editor command: bogus_cmd | redir END} |
{6:Press ENTER or type command to continue}^ |
]],
}
end)
@ -182,7 +176,7 @@ describe('clipboard', function()
feed_command('let @+="foo"')
screen:expect([[
^ |
{0:~ }|*2
{1:~ }|*2
clipboard: No provider. Try ":checkhealth" or ":h clipboard". |
]])
end)
@ -325,15 +319,11 @@ describe('clipboard (with fake clipboard.vim)', function()
it('`:redir @+>|bogus_cmd|redir END` must not recurse #7184', function()
local screen = Screen.new(72, 4)
screen:attach()
screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue },
[1] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
})
feed_command('redir @+> | bogus_cmd | redir END')
screen:expect([[
^ |
{0:~ }|*2
{1:E492: Not an editor command: bogus_cmd | redir END} |
{1:~ }|*2
{9:E492: Not an editor command: bogus_cmd | redir END} |
]])
end)
@ -719,9 +709,6 @@ describe('clipboard (with fake clipboard.vim)', function()
feed_command('set mouse=a')
local screen = Screen.new(30, 5)
screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue },
})
screen:attach()
insert([[
the source
@ -731,7 +718,7 @@ describe('clipboard (with fake clipboard.vim)', function()
screen:expect([[
the ^source |
a target |
{0:~ }|*2
{1:~ }|*2
|
]])

View File

@ -16,30 +16,24 @@ describe("'wildmenu'", function()
before_each(function()
clear()
screen = Screen.new(25, 5)
screen:set_default_attr_ids {
[1] = { foreground = Screen.colors.Blue, bold = true },
[2] = { reverse = true },
[3] = { bold = true, reverse = true },
[5] = { bold = true },
[31] = { foreground = Screen.colors.Grey0, background = Screen.colors.Yellow },
screen:add_extra_attr_ids {
[100] = { background = Screen.colors.Yellow1, foreground = Screen.colors.Black },
}
screen:attach()
end)
-- oldtest: Test_wildmenu_screendump()
it('works', function()
screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[1] = { foreground = Screen.colors.Black, background = Screen.colors.Yellow }, -- WildMenu
[2] = { bold = true, reverse = true }, -- StatusLine
})
screen:add_extra_attr_ids {
[100] = { background = Screen.colors.Yellow1, foreground = Screen.colors.Black },
}
-- Test simple wildmenu
feed(':sign <Tab>')
screen:expect {
grid = [[
|
{0:~ }|*2
{1:define}{2: jump list > }|
{1:~ }|*2
{100:define}{3: jump list > }|
:sign define^ |
]],
}
@ -48,8 +42,8 @@ describe("'wildmenu'", function()
screen:expect {
grid = [[
|
{0:~ }|*2
{2:define }{1:jump}{2: list > }|
{1:~ }|*2
{3:define }{100:jump}{3: list > }|
:sign jump^ |
]],
}
@ -58,8 +52,8 @@ describe("'wildmenu'", function()
screen:expect {
grid = [[
|
{0:~ }|*2
{2:define jump }{1:list}{2: > }|
{1:~ }|*2
{3:define jump }{100:list}{3: > }|
:sign list^ |
]],
}
@ -69,8 +63,8 @@ describe("'wildmenu'", function()
screen:expect {
grid = [[
|
{0:~ }|*2
{2:define jump list > }|
{1:~ }|*2
{3:define jump list > }|
:sign ^ |
]],
}
@ -80,7 +74,7 @@ describe("'wildmenu'", function()
screen:expect {
grid = [[
|
{0:~ }|*3
{1:~ }|*3
:sign ^ |
]],
}
@ -92,8 +86,8 @@ describe("'wildmenu'", function()
screen:expect {
grid = [[
|
{0:~ }|*2
{1:define}{2: jump list > }|
{1:~ }|*2
{100:define}{3: jump list > }|
:sign define^ |
]],
}
@ -104,7 +98,7 @@ describe("'wildmenu'", function()
screen:expect {
grid = [[
^ |
{0:~ }|*3
{1:~ }|*3
|
]],
}
@ -115,7 +109,7 @@ describe("'wildmenu'", function()
screen:expect([[
|
{1:~ }|*2
{31:define}{3: jump list > }|
{100:define}{3: jump list > }|
:sign define^ |
]])
feed('<C-E>')
@ -131,7 +125,7 @@ describe("'wildmenu'", function()
screen:expect([[
|
{1:~ }|*2
{31:define}{3: jump list > }|
{100:define}{3: jump list > }|
:sign define^ |
]])
feed('<tab><C-Y>')
@ -148,7 +142,7 @@ describe("'wildmenu'", function()
screen:expect([[
|
{1:~ }|*2
{31:define}{3: jump list > }|
{100:define}{3: jump list > }|
:sign define^ |
]])
end)
@ -162,7 +156,7 @@ describe("'wildmenu'", function()
screen:expect([[
|
{1:~ }|*2
{31:define}{3: jump list > }|
{100:define}{3: jump list > }|
:sign define^ |
]])
feed('<space>')
@ -188,7 +182,7 @@ describe("'wildmenu'", function()
screen:expect([[
|
{1:~ }|*2
{31:!}{3: # & < = > @ > }|
{100:!}{3: # & < = > @ > }|
:!^ |
]])
end)
@ -199,13 +193,17 @@ describe("'wildmenu'", function()
feed((':terminal "%s" REP 5000 !terminal_output!<cr>'):format(testprg('shell-test')))
feed('G') -- Follow :terminal output.
feed([[:sign <Tab>]]) -- Invoke wildmenu.
screen:set_default_attr_ids {
[31] = { foreground = Screen.colors.Black, background = Screen.colors.Yellow },
[32] = { bold = true, foreground = Screen.colors.White, background = Screen.colors.DarkGreen },
screen:add_extra_attr_ids {
[100] = { foreground = Screen.colors.Black, background = Screen.colors.Yellow },
[101] = {
bold = true,
foreground = Screen.colors.White,
background = Screen.colors.DarkGreen,
},
}
-- NB: in earlier versions terminal output was redrawn during cmdline mode.
-- For now just assert that the screen remains unchanged.
screen:expect { any = '{31:define}{32: jump list > }|\n:sign define^ |' }
screen:expect { any = '{100:define}{101: jump list > }|\n:sign define^ |' }
screen:expect_unchanged()
-- cmdline CTRL-D display should also be preserved.
@ -236,7 +234,7 @@ describe("'wildmenu'", function()
grid = [[
|
{1:~ }|*2
{31:define}{3: jump list > }|
{100:define}{3: jump list > }|
:sign define^ |
]],
}
@ -263,13 +261,17 @@ describe("'wildmenu'", function()
feed([[<C-\><C-N>]])
feed([[:<Tab>]]) -- Invoke wildmenu.
screen:set_default_attr_ids {
[31] = { foreground = Screen.colors.Black, background = Screen.colors.Yellow },
[32] = { bold = true, foreground = Screen.colors.White, background = Screen.colors.DarkGreen },
screen:add_extra_attr_ids {
[100] = { foreground = Screen.colors.Black, background = Screen.colors.Yellow },
[101] = {
bold = true,
foreground = Screen.colors.White,
background = Screen.colors.DarkGreen,
},
}
-- Check only the last 2 lines, because the shell output is
-- system-dependent.
screen:expect { any = '{31:!}{32: # & < = > @ > }|\n:!^' }
screen:expect { any = '{100:!}{101: # & < = > @ > }|\n:!^' }
-- Because this test verifies a _lack_ of activity, we must wait the full timeout.
-- So make it reasonable.
screen:expect_unchanged(false, 1000)
@ -298,7 +300,7 @@ describe("'wildmenu'", function()
{3: }|
:set wildm |
wildmenu wildmode |
{31:wildmenu}{3: wildmode }|
{100:wildmenu}{3: wildmode }|
:set wildmenu^ |
]])
feed('<Esc>')
@ -424,10 +426,8 @@ describe("'wildmenu'", function()
end)
it('works with c_CTRL_Z standard mapping', function()
screen:set_default_attr_ids {
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { foreground = Screen.colors.Grey0, background = Screen.colors.Yellow },
[3] = { bold = true, reverse = true },
screen:add_extra_attr_ids {
[100] = { background = Screen.colors.Yellow1, foreground = Screen.colors.Black },
}
-- Wildcharm? where we are going we aint't no need no wildcharm.
@ -444,7 +444,7 @@ describe("'wildmenu'", function()
grid = [[
|
{1:~ }|*2
{2:case}{3: clear cluster > }|
{100:case}{3: clear cluster > }|
:syntax case^ |
]],
}
@ -489,11 +489,9 @@ describe('command line completion', function()
before_each(function()
clear()
screen = Screen.new(40, 5)
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { foreground = Screen.colors.Grey0, background = Screen.colors.Yellow },
[3] = { bold = true, reverse = true },
})
screen:add_extra_attr_ids {
[100] = { background = Screen.colors.Yellow1, foreground = Screen.colors.Black },
}
screen:attach()
end)
after_each(function()
@ -521,7 +519,7 @@ describe('command line completion', function()
screen:expect([[
|
{1:~ }|*2
{2:XTEST_1}{3: XTEST_2 }|
{100:XTEST_1}{3: XTEST_2 }|
:!echo $XTEST_1^ |
]])
end)
@ -537,7 +535,7 @@ describe('command line completion', function()
screen:expect([[
|
{1:~ }|*2
{2:XTEST_1AaあB}{3: XTEST_2 }|
{100:XTEST_1AaあB}{3: XTEST_2 }|
:!echo $XTEST_1AaあB^ |
]])
end)