aboutsummaryrefslogtreecommitdiff
path: root/test/functional/editor/langmap_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/editor/langmap_spec.lua')
-rw-r--r--test/functional/editor/langmap_spec.lua36
1 files changed, 18 insertions, 18 deletions
diff --git a/test/functional/editor/langmap_spec.lua b/test/functional/editor/langmap_spec.lua
index e4349a22e7..b1070ecddc 100644
--- a/test/functional/editor/langmap_spec.lua
+++ b/test/functional/editor/langmap_spec.lua
@@ -30,7 +30,7 @@ describe("'langmap'", function()
command('nmapclear')
end)
it("'langnoremap' is by default ON", function()
- eq(eval('&langnoremap'), 1)
+ eq(1, eval('&langnoremap'))
end)
it("Results of maps are not converted when 'langnoremap' ON.",
function()
@@ -71,19 +71,19 @@ describe("'langmap'", function()
feed('<C-w>s')
local origwin = curwin()
feed('<C-w>i')
- neq(curwin(), origwin)
+ neq(origwin, curwin())
-- Works when setting a mark
feed('yy3p3gg0mwgg0mi')
- eq(call('getpos', "'i"), {0, 3, 1, 0})
- eq(call('getpos', "'w"), {0, 1, 1, 0})
+ eq({0, 3, 1, 0}, call('getpos', "'i"))
+ eq({0, 1, 1, 0}, call('getpos', "'w"))
feed('3dd')
-- Works when moving to a mark
feed("'i")
- eq(call('getpos', '.'), {0, 1, 1, 0})
+ eq({0, 1, 1, 0}, call('getpos', '.'))
-- Works when selecting a register
feed('qillqqwhhq')
- eq(eval('@i'), 'hh')
- eq(eval('@w'), 'll')
+ eq('hh', eval('@i'))
+ eq('ll', eval('@w'))
feed('a<C-r>i<esc>')
expect('illii www')
feed('"ip')
@@ -107,7 +107,7 @@ describe("'langmap'", function()
expect('wwi www')
feed('u@a')
expect('wwi www')
- eq(eval('@a'), ':s/i/w/gc\ryyn')
+ eq(':s/i/w/gc\ryyn', eval('@a'))
end)
it('insert-mode CTRL-G', function()
command('set langmap=jk,kj')
@@ -127,7 +127,7 @@ describe("'langmap'", function()
helhellolo
helxlo
hello]])
- eq(eval('@a'), 'gg3|ahellojx')
+ eq('gg3|ahellojx', eval('@a'))
end)
it('command-line CTRL-\\', function()
command('set langmap=en,ne')
@@ -145,8 +145,8 @@ describe("'langmap'", function()
set langmap=ij,ji
]])
feed(':let <C-R>i=1<CR>')
- eq(eval('i_value'), 1)
- eq(eval('j_value'), 0)
+ eq(1, eval('i_value'))
+ eq(0, eval('j_value'))
end)
-- it('-- More -- prompt', function()
-- -- The 'b' 'j' 'd' 'f' commands at the -- More -- prompt
@@ -186,17 +186,17 @@ describe("'langmap'", function()
nnoremap x :call Map()<CR>
]])
feed('x1<CR>')
- eq(eval('gotten_one'), 1)
+ eq(1, eval('gotten_one'))
command('let g:gotten_one = 0')
feed_command('call Map()')
feed('1<CR>')
- eq(eval('gotten_one'), 1)
+ eq(1, eval('gotten_one'))
end)
end)
it('conversions are not applied during setreg()',
function()
call('setreg', 'i', 'ww')
- eq(eval('@i'), 'ww')
+ eq('ww', eval('@i'))
end)
it('conversions not applied in insert mode', function()
feed('aiiiwww')
@@ -213,11 +213,11 @@ describe("'langmap'", function()
iii]])
end)
- local function testrecording(command_string, expect_string, setup_function)
+ local function testrecording(command_string, expect_string, setup_function, expect_macro)
if setup_function then setup_function() end
feed('qa' .. command_string .. 'q')
expect(expect_string)
- eq(helpers.funcs.nvim_replace_termcodes(command_string, true, true, true),
+ eq(expect_macro or helpers.funcs.nvim_replace_termcodes(command_string, true, true, true),
eval('@a'))
if setup_function then setup_function() end
-- n.b. may need nvim_replace_termcodes() here.
@@ -273,8 +273,8 @@ describe("'langmap'", function()
it('treats control modified keys as characters', function()
command('nnoremap <C-w> iw<esc>')
command('nnoremap <C-i> ii<esc>')
- testrecording('<C-w>', 'whello', local_setup)
- testrecording('<C-i>', 'ihello', local_setup)
+ testrecording('<C-w>', 'whello', local_setup, eval([["\<*C-w>"]]))
+ testrecording('<C-i>', 'ihello', local_setup, eval([["\<*C-i>"]]))
end)
end)