aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/cmdline_highlight_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-11-26 16:45:29 +0300
committerZyX <kp-pav@yandex.ru>2017-11-26 16:45:29 +0300
commitcddf84c3982b8225f1592b6a61b63f8d1883ca94 (patch)
treeb62bd35dce6aa6e95db1f31967df221ac8ca2092 /test/functional/ui/cmdline_highlight_spec.lua
parent17077b68133a62d0dc1b84cb48779464c117e028 (diff)
downloadrneovim-cddf84c3982b8225f1592b6a61b63f8d1883ca94.tar.gz
rneovim-cddf84c3982b8225f1592b6a61b63f8d1883ca94.tar.bz2
rneovim-cddf84c3982b8225f1592b6a61b63f8d1883ca94.zip
functests: Add some more tests
Diffstat (limited to 'test/functional/ui/cmdline_highlight_spec.lua')
-rw-r--r--test/functional/ui/cmdline_highlight_spec.lua87
1 files changed, 83 insertions, 4 deletions
diff --git a/test/functional/ui/cmdline_highlight_spec.lua b/test/functional/ui/cmdline_highlight_spec.lua
index 023673738d..54d27723f0 100644
--- a/test/functional/ui/cmdline_highlight_spec.lua
+++ b/test/functional/ui/cmdline_highlight_spec.lua
@@ -147,6 +147,10 @@ before_each(function()
PE={bold = true, foreground = Screen.colors.SeaGreen4},
NUM={foreground = Screen.colors.Blue2},
NPAR={foreground = Screen.colors.Yellow},
+ SQ={foreground = Screen.colors.Blue3},
+ SB={foreground = Screen.colors.Blue4},
+ E={foreground = Screen.colors.Red, background = Screen.colors.Blue},
+ M={bold = true},
})
end)
@@ -898,8 +902,83 @@ describe('Expressions coloring support', function()
={NUM:1}^ |
]])
end)
- -- FIXME: Test expr coloring when using -u NORC and -u NONE.
- -- FIXME: Test different ways of triggering expression highlighting (:<C-r>=,
- -- i<C-r>=, :<C-\>e, "=).
- -- FIXME: Test with various invalid unicode and multibyte characters.
+ it('works correctly with non-ASCII and control characters', function()
+ meths.command('hi clear NVimStringBody')
+ meths.command('hi clear NVimStringQuote')
+ meths.command('hi clear NVimInvalid')
+ meths.command('hi NVimStringQuote guifg=Blue3')
+ meths.command('hi NVimStringBody guifg=Blue4')
+ meths.command('hi NVimInvalid guifg=Red guibg=Blue')
+ feed('i<C-r>="«»"«»')
+ screen:expect([[
+ |
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ ={SQ:"}{SB:«»}{SQ:"}{E:«»}^ |
+ ]])
+ feed('<C-c>')
+ screen:expect([[
+ ^ |
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {M:-- INSERT --} |
+ ]])
+ feed('<Esc>')
+ screen:expect([[
+ ^ |
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ |
+ ]])
+ feed(':<C-\\>e"<C-v><C-x>"<C-v><C-x>')
+ -- TODO(ZyX-I): Parser highlighting should not override special character
+ -- highlighting.
+ screen:expect([[
+ |
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ ={SQ:"}{SB:^X}{SQ:"}{ERR:^X}^ |
+ ]])
+ feed('<C-c>')
+ screen:expect([[
+ |
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ :^ |
+ ]])
+ funcs.setreg('a', {'\192'})
+ feed('<C-r>="<C-r><C-r>a"<C-r><C-r>a"foo"')
+ -- TODO(ZyX-I): Parser highlighting should not override special character
+ -- highlighting.
+ screen:expect([[
+ |
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ ={SQ:"}{SB:<c0>}{SQ:"}{E:<c0>"}{SB:foo}{E:"}^ |
+ ]])
+ end)
end)