diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/autocmd/cursorhold_spec.lua | 31 | ||||
-rw-r--r-- | test/functional/eval/executable_spec.lua | 7 | ||||
-rw-r--r-- | test/functional/ui/messages_spec.lua | 41 |
3 files changed, 73 insertions, 6 deletions
diff --git a/test/functional/autocmd/cursorhold_spec.lua b/test/functional/autocmd/cursorhold_spec.lua new file mode 100644 index 0000000000..506b688853 --- /dev/null +++ b/test/functional/autocmd/cursorhold_spec.lua @@ -0,0 +1,31 @@ +local helpers = require('test.functional.helpers')(after_each) + +local clear = helpers.clear +local eq = helpers.eq +local eval = helpers.eval +local feed = helpers.feed +local retry = helpers.retry +local source = helpers.source +local sleep = helpers.sleep + +describe('CursorHoldI', function() + before_each(clear) + + -- NOTE: since this test uses RPC it is not necessary to trigger the initial + -- issue (#3757) via timer's or RPC callbacks in the first place. + it('is triggered after input', function() + source([[ + set updatetime=1 + + let g:cursorhold = 0 + augroup test + au CursorHoldI * let g:cursorhold += 1 + augroup END + ]]) + feed('ifoo') + retry(5, nil, function() + sleep(1) + eq(1, eval('g:cursorhold')) + end) + end) +end) diff --git a/test/functional/eval/executable_spec.lua b/test/functional/eval/executable_spec.lua index e346b786a6..1107fe6a0b 100644 --- a/test/functional/eval/executable_spec.lua +++ b/test/functional/eval/executable_spec.lua @@ -24,12 +24,7 @@ describe('executable()', function() eq('arg1=lemon;arg2=sky;arg3=tree;', call('system', sibling_exe..' lemon sky tree')) end - local is_executable = call('executable', sibling_exe) - if iswin() and is_executable ~= expected then - pending('XXX: sometimes fails on AppVeyor') - else - eq(expected, is_executable) - end + eq(expected, call('executable', sibling_exe)) end) describe('exec-bit', function() diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua index 09e13b1464..2857c2fe1e 100644 --- a/test/functional/ui/messages_spec.lua +++ b/test/functional/ui/messages_spec.lua @@ -804,6 +804,7 @@ describe('ui/builtin messages', function() [3] = {bold = true, reverse = true}, [4] = {bold = true, foreground = Screen.colors.SeaGreen4}, [5] = {foreground = Screen.colors.Blue1}, + [6] = {bold = true, foreground = Screen.colors.Magenta}, }) end) @@ -856,6 +857,46 @@ describe('ui/builtin messages', function() eq('ErrorMsg xxx ctermfg=15 ctermbg=1 guifg=White guibg=Red', meths.command_output("hi ErrorMsg")) end) + + it(':syntax list langGroup output', function() + command("syntax on") + command("set syntax=vim") + screen:try_resize(110,7) + feed(':syntax list vimComment<cr>') + screen:expect([[ + {6:--- Syntax items ---} | + vimComment {5:xxx} {5:match} /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 {5:excludenl} {5:contains}=@vimCommentGroup,vimCommentString | + | + {5:match} /\<endif\s\+".*$/ms=s+5,lc=5 {5:contains}=@vimCommentGroup,vimCommentString | + {5:match} /\<else\s\+".*$/ms=s+4,lc=4 {5:contains}=@vimCommentGroup,vimCommentString | + {5:links to} Comment | + {4:Press ENTER or type command to continue}^ | + ]]) + + feed('<cr>') + screen:try_resize(55,7) + feed(':syntax list vimComment<cr>') + screen:expect([[ + | + {5:match} /\<endif\s\+".*$/ms=s+5,lc=5 | + {5:contains}=@vimCommentGroup,vimCommentString | + {5:match} /\<else\s\+".*$/ms=s+4,lc=4 {5:c}| + {5:ontains}=@vimCommentGroup,vimCommentString | + {5:links to} Comment | + {4:Press ENTER or type command to continue}^ | + ]]) + feed('<cr>') + + -- ignore final whitespace inside string + -- luacheck: push ignore + eq([[--- Syntax items --- +vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vimCommentGroup,vimCommentString + match /\<endif\s\+".*$/ms=s+5,lc=5 contains=@vimCommentGroup,vimCommentString + match /\<else\s\+".*$/ms=s+4,lc=4 contains=@vimCommentGroup,vimCommentString + links to Comment]], + meths.command_output('syntax list vimComment')) + -- luacheck: pop + end) end) describe('ui/ext_messages', function() |