aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-05-21 23:07:34 +0200
committerbfredl <bjorn.linse@gmail.com>2022-05-21 23:07:34 +0200
commit3c1bc75447841a2cc4d0222657556aa172c91915 (patch)
treea7dc534297fc33875831958c7a6dac363ab069d1
parent1f1a65a9e4c602cd80458b213c28eadbdb5b1de1 (diff)
downloadrneovim-3c1bc75447841a2cc4d0222657556aa172c91915.tar.gz
rneovim-3c1bc75447841a2cc4d0222657556aa172c91915.tar.bz2
rneovim-3c1bc75447841a2cc4d0222657556aa172c91915.zip
fix(tests): fix some screen.lua warnings
-rw-r--r--test/functional/legacy/prompt_buffer_spec.lua19
-rw-r--r--test/functional/ui/bufhl_spec.lua10
-rw-r--r--test/functional/ui/messages_spec.lua6
-rw-r--r--test/functional/ui/searchhl_spec.lua44
-rw-r--r--test/functional/vimscript/execute_spec.lua4
5 files changed, 58 insertions, 25 deletions
diff --git a/test/functional/legacy/prompt_buffer_spec.lua b/test/functional/legacy/prompt_buffer_spec.lua
index 47eca19de3..63338b8dba 100644
--- a/test/functional/legacy/prompt_buffer_spec.lua
+++ b/test/functional/legacy/prompt_buffer_spec.lua
@@ -23,7 +23,7 @@ describe('prompt buffer', function()
close
else
call append(line("$") - 1, 'Command: "' . a:text . '"')
- set nomodfied
+ set nomodified
call timer_start(20, {id -> TimerFunc(a:text)})
endif
endfunc
@@ -33,7 +33,7 @@ describe('prompt buffer', function()
endfunc
func SwitchWindows()
- call timer_start(0, {-> execute("wincmd p|wincmd p", "")})
+ call timer_start(0, {-> execute("wincmd p", "")})
endfunc
]])
feed_command("set noshowmode | set laststatus=0")
@@ -187,7 +187,19 @@ describe('prompt buffer', function()
-- INSERT -- |
]])
feed("<C-O>:call SwitchWindows()<CR>")
- poke_eventloop()
+ screen:expect{grid=[[
+ cmd: |
+ ~ |
+ ~ |
+ ~ |
+ [Prompt] [+] |
+ ^other buffer |
+ ~ |
+ ~ |
+ ~ |
+ |
+ ]]}
+ feed("<C-O>:call SwitchWindows()<CR>")
screen:expect([[
cmd: ^ |
~ |
@@ -201,7 +213,6 @@ describe('prompt buffer', function()
-- INSERT -- |
]])
feed("<Esc>")
- poke_eventloop()
screen:expect([[
cmd:^ |
~ |
diff --git a/test/functional/ui/bufhl_spec.lua b/test/functional/ui/bufhl_spec.lua
index 9f84b71ece..7c0831bd09 100644
--- a/test/functional/ui/bufhl_spec.lua
+++ b/test/functional/ui/bufhl_spec.lua
@@ -564,6 +564,16 @@ describe('Buffer highlighting', function()
]]
clear_namespace(id, 0, -1)
+ screen:expect{grid=[[
+ fooba^r |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]]}
set_extmark(id, 0, 0, {
end_line = 0,
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index ee1e37c675..6ee6853e97 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -1209,7 +1209,6 @@ describe('ui/ext_messages', function()
it('supports global statusline', function()
feed(":set laststatus=3<cr>")
feed(":sp<cr>")
- feed("<c-l>")
feed(":set cmdheight<cr>")
screen:expect({grid=[[
^ |
@@ -1241,8 +1240,7 @@ describe('ui/ext_messages', function()
}})
feed("<c-w>+")
- feed("<c-l>")
- feed(":set cmdheight<cr>")
+ feed(":set laststatus<cr>")
screen:expect({grid=[[
^ |
{1:~ }|
@@ -1269,7 +1267,7 @@ describe('ui/ext_messages', function()
{1:~ }|
{7:[No Name] }|
]], messages={
- {content = { { " cmdheight=0" } }, kind = "" }
+ {content = { { " laststatus=3" } }, kind = "" }
}})
feed(":set mouse=a<cr>")
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua
index 56ff8a4101..cdb6256f77 100644
--- a/test/functional/ui/searchhl_spec.lua
+++ b/test/functional/ui/searchhl_spec.lua
@@ -43,7 +43,7 @@ describe('search highlighting', function()
insert("some text\nmore text")
feed_command('1,2fold')
feed("gg/text")
- screen:expect([[
+ screen:expect{grid=[[
{6:+-- 2 lines: some text·················}|
{1:~ }|
{1:~ }|
@@ -51,7 +51,9 @@ describe('search highlighting', function()
{1:~ }|
{1:~ }|
/text^ |
- ]])
+ ]], win_viewport={
+ [2] = {win = {id = 1000}, topline = 0, botline = 3, curline = 0, curcol = 9, linecount = 2};
+ }}
end)
it('works', function()
@@ -579,19 +581,20 @@ describe('search highlighting', function()
end)
it('works with matchadd and syntax', function()
- screen:set_default_attr_ids( {
- [1] = {bold=true, foreground=Screen.colors.Blue},
- [2] = {background = colors.Yellow},
- [3] = {reverse = true},
- [4] = {foreground = colors.Red},
- [5] = {bold = true, background = colors.Green},
- [6] = {italic = true, background = colors.Magenta},
- [7] = {bold = true, background = colors.Yellow},
- } )
+ screen:set_default_attr_ids {
+ [1] = {bold=true, foreground=Screen.colors.Blue};
+ [2] = {background = colors.Yellow};
+ [3] = {reverse = true};
+ [4] = {foreground = colors.Red};
+ [5] = {bold = true, background = colors.Green};
+ [6] = {italic = true, background = colors.Magenta};
+ [7] = {bold = true, background = colors.Yellow};
+ [8] = {foreground = Screen.colors.Blue4, background = Screen.colors.LightGray};
+ }
feed_command('set hlsearch')
- insert([[
+ insert [[
very special text
- ]])
+ ]]
feed_command("syntax on")
feed_command("highlight MyGroup guibg=Green gui=bold")
feed_command("highlight MyGroup2 guibg=Magenta gui=italic")
@@ -601,7 +604,7 @@ describe('search highlighting', function()
-- searchhl and matchadd matches are exclusive, only the highest priority
-- is used (and matches with lower priorities are not combined)
feed_command("/ial te")
- screen:expect([[
+ screen:expect{grid=[[
very {5:spec^ial}{2: te}{6:xt} |
|
{1:~ }|
@@ -609,10 +612,21 @@ describe('search highlighting', function()
{1:~ }|
{1:~ }|
{4:search hit BOTTOM, continuing at TOP} |
- ]])
+ ]], win_viewport={
+ [2] = {win = {id = 1000}, topline = 0, botline = 3, curline = 0, curcol = 11, linecount = 2};
+ }}
-- check highlights work also in folds
feed("zf4j")
+ screen:expect{grid=[[
+ {8:^+-- 2 lines: very special text·········}|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {4:search hit BOTTOM, continuing at TOP} |
+ ]]}
command("%foldopen")
screen:expect([[
very {5:spec^ial}{2: te}{6:xt} |
diff --git a/test/functional/vimscript/execute_spec.lua b/test/functional/vimscript/execute_spec.lua
index e21c71dc7f..a733b098f5 100644
--- a/test/functional/vimscript/execute_spec.lua
+++ b/test/functional/vimscript/execute_spec.lua
@@ -153,7 +153,7 @@ describe('execute()', function()
function! Test3()
echo 1234
let x = execute('echoerr "abcdef"', 'silent!')
- echon 'ABCD'
+ echon 'ABCDXZYZ'
endfunction
" test 4: silenced echoerr goes as usual
@@ -214,7 +214,7 @@ describe('execute()', function()
~ |
~ |
~ |
- 1234ABCD |
+ 1234ABCDXZYZ |
]])
feed([[:call Test4()<cr>]])