diff options
author | Rainer Borene <rainerborene@gmail.com> | 2014-11-09 18:54:33 -0200 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-11-20 21:06:37 -0300 |
commit | a93d370c75da5fbdd04176bf881a95833989ea02 (patch) | |
tree | 5ba8960aa3cbe4736c66f8a07c3e4c1ac8cef4ed /test/functional/legacy/051_highlight_spec.lua | |
parent | c9159586b87168c0725524165f33607ebb83efd7 (diff) | |
download | rneovim-a93d370c75da5fbdd04176bf881a95833989ea02.tar.gz rneovim-a93d370c75da5fbdd04176bf881a95833989ea02.tar.bz2 rneovim-a93d370c75da5fbdd04176bf881a95833989ea02.zip |
legacy tests: migrate test51
Diffstat (limited to 'test/functional/legacy/051_highlight_spec.lua')
-rw-r--r-- | test/functional/legacy/051_highlight_spec.lua | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/test/functional/legacy/051_highlight_spec.lua b/test/functional/legacy/051_highlight_spec.lua new file mode 100644 index 0000000000..f35b70f93f --- /dev/null +++ b/test/functional/legacy/051_highlight_spec.lua @@ -0,0 +1,70 @@ +-- vim: set foldmethod=marker foldmarker=[[,]] : +-- Tests for ":highlight". + +local helpers = require('test.functional.helpers') +local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert +local execute, expect = helpers.execute, helpers.expect + +describe(':highlight', function() + setup(clear) + + it('is working', function() + -- Basic test if ":highlight" doesn't crash + execute('highlight') + execute('hi Search') + + -- Test setting colors. + -- Test clearing one color and all doesn't generate error or warning + execute('hi NewGroup term=bold cterm=italic ctermfg=DarkBlue ctermbg=Grey gui= guifg=#00ff00 guibg=Cyan') + execute('hi Group2 term= cterm=') + execute('hi Group3 term=underline cterm=bold') + execute('redir! @a') + execute('hi NewGroup') + execute('hi Group2') + execute('hi Group3') + execute('hi clear NewGroup') + execute('hi NewGroup') + execute('hi Group2') + execute('hi Group2 NONE') + execute('hi Group2') + execute('hi clear') + execute('hi Group3') + execute([[hi Crash term='asdf]]) + execute('redir END') + + -- Filter ctermfg and ctermbg, the numbers depend on the terminal + execute('0put a') + execute([[%s/ctermfg=\d*/ctermfg=2/]]) + execute([[%s/ctermbg=\d*/ctermbg=3/]]) + + -- Filter out possibly translated error message + execute('%s/E475: [^:]*:/E475:/') + + -- Fix the fileformat + execute('set ff&') + execute('$d') + + -- Assert buffer contents. + expect([[ + + + NewGroup xxx term=bold cterm=italic ctermfg=2 ctermbg=3 + + Group2 xxx cleared + + Group3 xxx term=underline cterm=bold + + + NewGroup xxx cleared + + Group2 xxx cleared + + + Group2 xxx cleared + + + Group3 xxx cleared + + E475: term='asdf]]) + end) +end) |