diff options
author | ZyX <kp-pav@yandex.ru> | 2017-04-09 01:43:46 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-04-09 03:24:09 +0300 |
commit | ed0ad7ce3e491ec65f05149079dccda22de22241 (patch) | |
tree | e4dee2397c698792944c52668d755636b7ddb33f | |
parent | a1b81f7ecad0c0b60aab536b09d6ea94f41626c3 (diff) | |
download | rneovim-ed0ad7ce3e491ec65f05149079dccda22de22241.tar.gz rneovim-ed0ad7ce3e491ec65f05149079dccda22de22241.tar.bz2 rneovim-ed0ad7ce3e491ec65f05149079dccda22de22241.zip |
functests: Fix legacy/051_highlight_spec test
-rw-r--r-- | test/functional/legacy/051_highlight_spec.lua | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/test/functional/legacy/051_highlight_spec.lua b/test/functional/legacy/051_highlight_spec.lua index b98c1ac2d5..60d29246ff 100644 --- a/test/functional/legacy/051_highlight_spec.lua +++ b/test/functional/legacy/051_highlight_spec.lua @@ -4,7 +4,9 @@ local Screen = require('test.functional.ui.screen') local helpers = require('test.functional.helpers')(after_each) local clear, feed = helpers.clear, helpers.feed local command, expect = helpers.command, helpers.expect +local eq = helpers.eq local wait = helpers.wait +local exc_exec = helpers.exc_exec if helpers.pending_win32(pending) then return end @@ -15,7 +17,8 @@ describe(':highlight', function() local screen = Screen.new(35, 10) screen:attach() -- Basic test if ":highlight" doesn't crash - command('set more', 'highlight') + command('set more') + feed(':highlight<CR>') -- FIXME(tarruda): We need to be sure the prompt is displayed before -- continuing, or risk a race condition where some of the following input -- is discarded resulting in test failure @@ -51,7 +54,8 @@ describe(':highlight', function() command('hi Group2') command('hi clear') command('hi Group3') - command([[hi Crash cterm='asdf]]) + eq('Vim(highlight):E475: Invalid argument: cterm=\'asdf', + exc_exec([[hi Crash cterm='asdf]])) command('redir END') -- Filter ctermfg and ctermbg, the numbers depend on the terminal @@ -59,9 +63,6 @@ describe(':highlight', function() command([[%s/ctermfg=\d*/ctermfg=2/]]) command([[%s/ctermbg=\d*/ctermbg=3/]]) - -- Filter out possibly translated error message - command('%s/E475: [^:]*:/E475:/') - -- Fix the fileformat command('set ff&') command('$d') @@ -69,29 +70,17 @@ describe(':highlight', function() -- Assert buffer contents. expect([[ - NewGroup xxx cterm=italic ctermfg=2 ctermbg=3 guifg=#00ff00 guibg=Cyan - Group2 xxx cleared - Group3 xxx cterm=bold - - NewGroup xxx cleared - Group2 xxx cleared - - Group2 xxx cleared - - - Group3 xxx cleared - - E475: cterm='asdf]]) + Group3 xxx cleared]]) screen:detach() end) end) |