aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/eval/printf_spec.lua60
-rw-r--r--test/functional/job/job_spec.lua29
-rw-r--r--test/functional/legacy/035_increment_and_decrement_spec.lua26
-rw-r--r--test/functional/legacy/039_visual_block_mode_commands_spec.lua234
-rw-r--r--test/functional/legacy/057_sort_spec.lua35
-rw-r--r--test/functional/legacy/cdo_spec.lua226
-rw-r--r--test/functional/legacy/mapping_spec.lua17
-rw-r--r--test/functional/ui/mouse_spec.lua1
-rw-r--r--test/includes/pre/fcntl.h (renamed from test/includes/pre/sys/fcntl.h)2
-rw-r--r--test/unit/os/env_spec.lua4
-rw-r--r--test/unit/os/fs_spec.lua2
11 files changed, 622 insertions, 14 deletions
diff --git a/test/functional/eval/printf_spec.lua b/test/functional/eval/printf_spec.lua
new file mode 100644
index 0000000000..6180f4156a
--- /dev/null
+++ b/test/functional/eval/printf_spec.lua
@@ -0,0 +1,60 @@
+local helpers = require('test.functional.helpers')
+local clear = helpers.clear
+local eq = helpers.eq
+local funcs = helpers.funcs
+local exc_exec = helpers.exc_exec
+
+describe('printf()', function()
+ before_each(clear)
+
+ it('works with zero and %b', function()
+ eq('0', funcs.printf('%lb', 0))
+ eq('0', funcs.printf('%llb', 0))
+ eq('0', funcs.printf('%zb', 0))
+ end)
+ it('works with one and %b', function()
+ eq('1', funcs.printf('%b', 1))
+ eq('1', funcs.printf('%lb', 1))
+ eq('1', funcs.printf('%llb', 1))
+ eq('1', funcs.printf('%zb', 1))
+ end)
+ it('works with 0xff and %b', function()
+ eq('11111111', funcs.printf('%b', 0xff))
+ eq('11111111', funcs.printf('%lb', 0xff))
+ eq('11111111', funcs.printf('%llb', 0xff))
+ eq('11111111', funcs.printf('%zb', 0xff))
+ end)
+ it('accepts width modifier with %b', function()
+ eq(' 1', funcs.printf('%3b', 1))
+ end)
+ it('accepts prefix modifier with %b', function()
+ eq('0b1', funcs.printf('%#b', 1))
+ end)
+ it('writes capital B with %B', function()
+ eq('0B1', funcs.printf('%#B', 1))
+ end)
+ it('accepts prefix, zero-fill and width modifiers with %b', function()
+ eq('0b001', funcs.printf('%#05b', 1))
+ end)
+ it('accepts prefix and width modifiers with %b', function()
+ eq(' 0b1', funcs.printf('%#5b', 1))
+ end)
+ it('does not write prefix for zero with prefix and width modifier used with %b', function()
+ eq(' 0', funcs.printf('%#5b', 0))
+ end)
+ it('accepts precision modifier with %b', function()
+ eq('00000', funcs.printf('%.5b', 0))
+ end)
+ it('accepts all modifiers with %b at once', function()
+ -- zero-fill modifier is ignored when used with left-align
+ -- force-sign and add-blank are ignored
+ -- use-grouping-characters modifier is ignored always
+ eq('0b00011 ', funcs.printf('% \'+#0-10.5b', 3))
+ end)
+ it('errors out when %b modifier is used for a list', function()
+ eq('Vim(call):E745: Using a List as a Number', exc_exec('call printf("%b", [])'))
+ end)
+ it('errors out when %b modifier is used for a float', function()
+ eq('Vim(call):E805: Using a Float as a Number', exc_exec('call printf("%b", 3.1415926535)'))
+ end)
+end)
diff --git a/test/functional/job/job_spec.lua b/test/functional/job/job_spec.lua
index 0915ab0955..d21b9051e2 100644
--- a/test/functional/job/job_spec.lua
+++ b/test/functional/job/job_spec.lua
@@ -142,6 +142,35 @@ describe('jobs', function()
nvim('command', "call jobstart(['cat', '-'], g:job_opts)")
end)
+ it('can get the pid value using getpid', function()
+ nvim('command', "let j = jobstart(['cat', '-'], g:job_opts)")
+ local pid = eval('jobpid(j)')
+ eq(0,os.execute('ps -p '..pid..' > /dev/null'))
+ nvim('command', 'call jobstop(j)')
+ eq({'notification', 'exit', {0, 0}}, next_msg())
+ neq(0,os.execute('ps -p '..pid..' > /dev/null'))
+ end)
+
+ it("doesn't survive the exit of nvim", function()
+ -- use sleep, which doesn't die on stdin close
+ nvim('command', "let j = jobstart(['sleep', '1000'], g:job_opts)")
+ local pid = eval('jobpid(j)')
+ eq(0,os.execute('ps -p '..pid..' > /dev/null'))
+ clear()
+ neq(0,os.execute('ps -p '..pid..' > /dev/null'))
+ end)
+
+ it('can survive the exit of nvim with "detach"', function()
+ nvim('command', 'let g:job_opts.detach = 1')
+ nvim('command', "let j = jobstart(['sleep', '1000'], g:job_opts)")
+ local pid = eval('jobpid(j)')
+ eq(0,os.execute('ps -p '..pid..' > /dev/null'))
+ clear()
+ eq(0,os.execute('ps -p '..pid..' > /dev/null'))
+ -- clean up after ourselves
+ os.execute('kill -9 '..pid..' > /dev/null')
+ end)
+
it('can pass user data to the callback', function()
nvim('command', 'let g:job_opts.user = {"n": 5, "s": "str", "l": [1]}')
nvim('command', "call jobstart(['echo'], g:job_opts)")
diff --git a/test/functional/legacy/035_increment_and_decrement_spec.lua b/test/functional/legacy/035_increment_and_decrement_spec.lua
index 20c0cc4206..e6252c384b 100644
--- a/test/functional/legacy/035_increment_and_decrement_spec.lua
+++ b/test/functional/legacy/035_increment_and_decrement_spec.lua
@@ -11,34 +11,40 @@ describe('increment and decrement commands', function()
it('should work', function()
-- Insert some numbers in various bases.
insert([[
- 100 0x100 077 0
- 100 0x100 077
+ 0b101 100 0x100 077 0
+ 0b101 100 0x100 077
100 0x100 077 0xfF 0xFf
- 100 0x100 077]])
+ 100 0x100 077
+ 0x0b101 0b1101]])
-- Increment and decrement numbers in the first row, interpreting the
-- numbers as decimal, octal or hexadecimal.
- execute('set nrformats=octal,hex', '1')
- feed('102ll64128$')
+ execute('set nrformats=bin,octal,hex', '1')
+ feed('63l102ll64128$')
-- For the second row, treat the numbers as decimal or octal.
-- 0x100 should be interpreted as decimal 0, the character x, and decimal 100.
execute('set nrformats=octal', '2')
- feed('0102l2w65129blx6lD')
+ feed('0w102l2w65129blx6lD')
-- For the third row, treat the numbers as decimal or hexadecimal.
-- 077 should be interpreted as decimal 77.
execute('set nrformats=hex', '3')
feed('0101l257Txldt   ')
- -- For the last row, interpret all numbers as decimal.
+ -- For the fourth row, interpret all numbers as decimal.
execute('set nrformats=', '4')
feed('0200l100w78')
+ -- For the last row, interpret as binary and hexadecimal.
+ execute('set nrformats=bin,hex', '5')
+ feed('010065l6432')
+
expect([[
- 0 0x0ff 0000 -1
- 0 1x100 0777777
+ 0b011 0 0x0ff 0000 -1
+ 1b101 0 1x100 0777777
-1 0x0 078 0xFE 0xfe
- -100 -100x100 000]])
+ -100 -100x100 000
+ 0x0b0de 0b0101101]])
end)
end)
diff --git a/test/functional/legacy/039_visual_block_mode_commands_spec.lua b/test/functional/legacy/039_visual_block_mode_commands_spec.lua
new file mode 100644
index 0000000000..55db9169fa
--- /dev/null
+++ b/test/functional/legacy/039_visual_block_mode_commands_spec.lua
@@ -0,0 +1,234 @@
+-- Test Visual block mode commands
+-- And test "U" in Visual mode, also on German sharp S.
+
+local helpers = require('test.functional.helpers')
+local nvim, eq = helpers.meths, helpers.eq
+local insert, feed = helpers.insert, helpers.feed
+local clear, expect = helpers.clear, helpers.expect
+local source, execute = helpers.source, helpers.execute
+
+describe('Visual block mode', function()
+
+ before_each(function()
+ clear()
+
+ execute('set ts&vi sw&vi sts&vi noet') -- Vim compatible
+ end)
+
+ it('should shift, insert, replace and change a block', function()
+ insert([[
+ abcdefghijklm
+ abcdefghijklm
+ abcdefghijklm
+ abcdefghijklm
+ abcdefghijklm]])
+
+ feed('gg')
+ -- Test shift-right of a block
+ feed('jllll<C-v>jj>wll<C-v>jlll><CR>')
+ -- Test shift-left of a block
+ feed('G$hhhh<C-v>kk<lt>')
+ -- Test block-insert
+ feed('Gkl<C-v>kkkIxyz<ESC>')
+ -- Test block-replace
+ feed('Gllll<C-v>kkklllrq')
+ -- Test block-change
+ feed('G$khhh<C-v>hhkkcmno<ESC>')
+
+ expect([[
+ axyzbcdefghijklm
+ axyzqqqq mno ghijklm
+ axyzqqqqef mno ghijklm
+ axyzqqqqefgmnoklm
+ abcdqqqqijklm]])
+ end)
+
+ it('should insert a block using cursor keys for movement', function()
+ insert([[
+ aaaaaa
+ bbbbbb
+ cccccc
+ dddddd
+
+ xaaa
+ bbbb
+ cccc
+ dddd]])
+
+ execute('/^aa')
+ feed('l<C-v>jjjlllI<Right><Right> <ESC>')
+ execute('/xaaa$')
+ feed('<C-v>jjjI<lt>><Left>p<ESC>')
+
+ expect([[
+ aaa aaa
+ bbb bbb
+ ccc ccc
+ ddd ddd
+
+ <p>xaaa
+ <p>bbbb
+ <p>cccc
+ <p>dddd]])
+ end)
+
+ it('should create a block', function()
+ insert([[
+ A23
+ 4567
+
+ B23
+ 4567
+
+ C23
+ 4567]])
+
+ -- Test for Visual block was created with the last <C-v>$.
+ execute('/^A23$/')
+ feed('l<C-v>j$Aab<ESC>')
+ -- Test for Visual block was created with the middle <C-v>$ (1).
+ execute('/^B23$/')
+ feed('l<C-v>j$hAab<ESC>')
+ -- Test for Visual block was created with the middle <C-v>$ (2).
+ execute('/^C23$/')
+ feed('l<C-v>j$hhAab<ESC>')
+
+ expect([[
+ A23ab
+ 4567ab
+
+ B23 ab
+ 4567ab
+
+ C23ab
+ 456ab7]])
+ end)
+
+ it('should insert and append a block when virtualedit=all', function()
+ insert([[
+ line1
+ line2
+ line3
+ ]])
+
+ -- Test for Visual block insert when virtualedit=all and utf-8 encoding.
+ execute('set ve=all')
+ execute('/\t\tline')
+ feed('07l<C-v>jjIx<ESC>')
+
+ expect([[
+ x line1
+ x line2
+ x line3
+ ]])
+
+ -- Test for Visual block append when virtualedit=all.
+ feed('012l<C-v>jjAx<ESC>')
+
+ expect([[
+ x x line1
+ x x line2
+ x x line3
+ ]])
+ end)
+
+ it('should make a selected part uppercase', function()
+ -- GUe must uppercase a whole word, also when ß changes to SS.
+ feed('Gothe youtußeuu end<ESC>Ypk0wgUe<CR>')
+ -- GUfx must uppercase until x, inclusive.
+ feed('O- youßtußexu -<ESC>0fogUfx<CR>')
+ -- VU must uppercase a whole line.
+ feed('YpkVU<CR>')
+ -- Same, when it's the last line in the buffer.
+ feed('YPGi111<ESC>VUddP<CR>')
+ -- Uppercase two lines.
+ feed('Oblah di<CR>')
+ feed('doh dut<ESC>VkUj<CR>')
+ -- Uppercase part of two lines.
+ feed('ddppi333<ESC>k0i222<esc>fyllvjfuUk<CR>')
+
+ expect([[
+
+ the YOUTUSSEUU end
+ - yOUSSTUSSEXu -
+ THE YOUTUSSEUU END
+ 111THE YOUTUSSEUU END
+ BLAH DI
+ DOH DUT
+ 222the yoUTUSSEUU END
+ 333THE YOUTUßeuu end]])
+ end)
+
+ it('should replace using Enter or NL', function()
+ -- Visual replace using Enter or NL.
+ feed('G3o123456789<ESC>2k05l<C-v>2jr<CR>')
+ feed('G3o98765<ESC>2k02l<C-v>2jr<C-v><CR>')
+ feed('G3o123456789<ESC>2k05l<C-v>2jr<CR>')
+ feed('G3o98765<ESC>2k02l<C-v>2jr<C-v><Nul>')
+
+ local expected = [[
+
+ 12345
+ 789
+ 12345
+ 789
+ 12345
+ 789
+ 98<CR>65
+ 98<CR>65
+ 98<CR>65
+ 12345
+ 789
+ 12345
+ 789
+ 12345
+ 789
+ 98<Nul>65
+ 98<Nul>65
+ 98<Nul>65]]
+ expected = expected:gsub('<CR>', '\r')
+ expected = expected:gsub('<Nul>', '\x00')
+
+ expect(expected)
+ end)
+
+ it('should treat cursor position correctly when virtualedit=block', function()
+ insert([[
+ 12345
+ 789
+ 98765]])
+
+ -- Test cursor position. When virtualedit=block and Visual block mode and $gj.
+ execute('set ve=block')
+ feed('G2l')
+ feed('2k<C-v>$gj<ESC>')
+ execute([[let cpos=getpos("'>")]])
+ local cpos = nvim.get_var('cpos')
+ local expected = {
+ col = 4,
+ off = 0
+ }
+ local actual = {
+ col = cpos[3],
+ off = cpos[4]
+ }
+
+ eq(expected, actual)
+ end)
+
+ it('should replace spaces in front of the block with tabs', function()
+ insert([[
+ #define BO_ALL 0x0001
+ #define BO_BS 0x0002
+ #define BO_CRSR 0x0004]])
+
+ -- Block_insert when replacing spaces in front of the block with tabs.
+ execute('set ts=8 sts=4 sw=4')
+ feed('ggf0<C-v>2jI<TAB><ESC>')
+
+ expect([[
+ #define BO_ALL 0x0001
+ #define BO_BS 0x0002
+ #define BO_CRSR 0x0004]])
+ end)
+end)
diff --git a/test/functional/legacy/057_sort_spec.lua b/test/functional/legacy/057_sort_spec.lua
index 585b391198..65defbae96 100644
--- a/test/functional/legacy/057_sort_spec.lua
+++ b/test/functional/legacy/057_sort_spec.lua
@@ -600,4 +600,39 @@ describe(':sort', function()
eq('Vim(sort):E474: Invalid argument', eval('tmpvar'))
expect(text)
end)
+
+ it('binary', function()
+ insert([[
+ 0b111000
+ 0b101100
+ 0b101001
+ 0b101001
+ 0b101000
+ 0b000000
+ 0b001000
+ 0b010000
+ 0b101000
+ 0b100000
+ 0b101010
+ 0b100010
+ 0b100100
+ 0b100010]])
+ execute([[sort b]])
+ expect([[
+ 0b000000
+ 0b001000
+ 0b010000
+ 0b100000
+ 0b100010
+ 0b100010
+ 0b100100
+ 0b101000
+ 0b101000
+ 0b101001
+ 0b101001
+ 0b101010
+ 0b101100
+ 0b111000]])
+ end)
+
end)
diff --git a/test/functional/legacy/cdo_spec.lua b/test/functional/legacy/cdo_spec.lua
new file mode 100644
index 0000000000..4b313ede3f
--- /dev/null
+++ b/test/functional/legacy/cdo_spec.lua
@@ -0,0 +1,226 @@
+-- Tests for the :cdo, :cfdo, :ldo and :lfdo commands
+
+local helpers = require('test.functional.helpers')
+local nvim, clear = helpers.meths, helpers.clear
+local call, feed = helpers.call, helpers.feed
+local source, eq = helpers.source, helpers.eq
+
+local function expected_empty()
+ eq({}, nvim.get_vvar('errors'))
+end
+
+describe('cdo', function()
+ before_each(function()
+ clear()
+
+ call('writefile', {'Line1', 'Line2', 'Line3'}, 'Xtestfile1')
+ call('writefile', {'Line1', 'Line2', 'Line3'}, 'Xtestfile2')
+ call('writefile', {'Line1', 'Line2', 'Line3'}, 'Xtestfile3')
+
+ source([=[
+ " Returns the current line in '<filename> <linenum>L <column>C' format
+ function GetRuler()
+ return expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C'
+ endfunction
+
+ " Tests for the :cdo and :ldo commands
+ function XdoTests(cchar)
+ enew
+
+ " Shortcuts for calling the cdo and ldo commands
+ let Xdo = a:cchar . 'do'
+ let Xgetexpr = a:cchar . 'getexpr'
+ let Xprev = a:cchar. 'prev'
+ let XdoCmd = Xdo . ' call add(l, GetRuler())'
+
+ " Try with an empty list
+ let l = []
+ exe XdoCmd
+ call assert_equal([], l)
+
+ " Populate the list and then try
+ exe Xgetexpr . " ['non-error 1', 'Xtestfile1:1:3:Line1', 'non-error 2', 'Xtestfile2:2:2:Line2', 'non-error 3', 'Xtestfile3:3:1:Line3']"
+
+ let l = []
+ exe XdoCmd
+ call assert_equal(['Xtestfile1 1L 3C', 'Xtestfile2 2L 2C', 'Xtestfile3 3L 1C'], l)
+
+ " Run command only on selected error lines
+ let l = []
+ enew
+ exe "2,3" . XdoCmd
+ call assert_equal(['Xtestfile2 2L 2C', 'Xtestfile3 3L 1C'], l)
+
+ " Boundary condition tests
+ let l = []
+ enew
+ exe "1,1" . XdoCmd
+ call assert_equal(['Xtestfile1 1L 3C'], l)
+
+ let l = []
+ enew
+ exe "3" . XdoCmd
+ call assert_equal(['Xtestfile3 3L 1C'], l)
+
+ " Range test commands
+ let l = []
+ enew
+ exe "%" . XdoCmd
+ call assert_equal(['Xtestfile1 1L 3C', 'Xtestfile2 2L 2C', 'Xtestfile3 3L 1C'], l)
+
+ let l = []
+ enew
+ exe "1,$" . XdoCmd
+ call assert_equal(['Xtestfile1 1L 3C', 'Xtestfile2 2L 2C', 'Xtestfile3 3L 1C'], l)
+
+ let l = []
+ enew
+ exe Xprev
+ exe "." . XdoCmd
+ call assert_equal(['Xtestfile2 2L 2C'], l)
+
+ let l = []
+ enew
+ exe "+" . XdoCmd
+ call assert_equal(['Xtestfile3 3L 1C'], l)
+
+ " Invalid error lines test
+ let l = []
+ enew
+ exe "silent! 27" . XdoCmd
+ exe "silent! 4,5" . XdoCmd
+ call assert_equal([], l)
+
+ " Run commands from an unsaved buffer
+ let v:errmsg=''
+ let l = []
+ enew
+ setlocal modified
+ exe "silent! 2,2" . XdoCmd
+ if v:errmsg !~# 'No write since last change'
+ call add(v:errors, 'Unsaved file change test failed')
+ endif
+
+ " If the executed command fails, then the operation should be aborted
+ enew!
+ let subst_count = 0
+ exe "silent!" . Xdo . " s/Line/xLine/ | let subst_count += 1"
+ if subst_count != 1 || getline('.') != 'xLine1'
+ call add(v:errors, 'Abort command on error test failed')
+ endif
+
+ let l = []
+ exe "2,2" . Xdo . "! call add(l, GetRuler())"
+ call assert_equal(['Xtestfile2 2L 2C'], l)
+
+ " List with no valid error entries
+ let l = []
+ edit! +2 Xtestfile1
+ exe Xgetexpr . " ['non-error 1', 'non-error 2', 'non-error 3']"
+ exe XdoCmd
+ call assert_equal([], l)
+ exe "silent! 2" . XdoCmd
+ call assert_equal([], l)
+ let v:errmsg=''
+ exe "%" . XdoCmd
+ exe "1,$" . XdoCmd
+ exe "." . XdoCmd
+ call assert_equal('', v:errmsg)
+
+ " List with only one valid entry
+ let l = []
+ exe Xgetexpr . " ['Xtestfile3:3:1:Line3']"
+ exe XdoCmd
+ call assert_equal(['Xtestfile3 3L 1C'], l)
+
+ endfunction
+
+ " Tests for the :cfdo and :lfdo commands
+ function XfdoTests(cchar)
+ enew
+
+ " Shortcuts for calling the cfdo and lfdo commands
+ let Xfdo = a:cchar . 'fdo'
+ let Xgetexpr = a:cchar . 'getexpr'
+ let XfdoCmd = Xfdo . ' call add(l, GetRuler())'
+ let Xpfile = a:cchar. 'pfile'
+
+ " Clear the quickfix/location list
+ exe Xgetexpr . " []"
+
+ " Try with an empty list
+ let l = []
+ exe XfdoCmd
+ call assert_equal([], l)
+
+ " Populate the list and then try
+ exe Xgetexpr . " ['non-error 1', 'Xtestfile1:1:3:Line1', 'Xtestfile1:2:1:Line2', 'non-error 2', 'Xtestfile2:2:2:Line2', 'non-error 3', 'Xtestfile3:2:3:Line2', 'Xtestfile3:3:1:Line3']"
+
+ let l = []
+ exe XfdoCmd
+ call assert_equal(['Xtestfile1 1L 3C', 'Xtestfile2 2L 2C', 'Xtestfile3 2L 3C'], l)
+
+ " Run command only on selected error lines
+ let l = []
+ exe "2,3" . XfdoCmd
+ call assert_equal(['Xtestfile2 2L 2C', 'Xtestfile3 2L 3C'], l)
+
+ " Boundary condition tests
+ let l = []
+ exe "3" . XfdoCmd
+ call assert_equal(['Xtestfile3 2L 3C'], l)
+
+ " Range test commands
+ let l = []
+ exe "%" . XfdoCmd
+ call assert_equal(['Xtestfile1 1L 3C', 'Xtestfile2 2L 2C', 'Xtestfile3 2L 3C'], l)
+
+ let l = []
+ exe "1,$" . XfdoCmd
+ call assert_equal(['Xtestfile1 1L 3C', 'Xtestfile2 2L 2C', 'Xtestfile3 2L 3C'], l)
+
+ let l = []
+ exe Xpfile
+ exe "." . XfdoCmd
+ call assert_equal(['Xtestfile2 2L 2C'], l)
+
+ " List with only one valid entry
+ let l = []
+ exe Xgetexpr . " ['Xtestfile2:2:5:Line2']"
+ exe XfdoCmd
+ call assert_equal(['Xtestfile2 2L 5C'], l)
+
+ endfunction
+ ]=])
+ end)
+
+ after_each(function()
+ os.remove('Xtestfile1')
+ os.remove('Xtestfile2')
+ os.remove('Xtestfile3')
+ end)
+
+ it('works for :cdo', function()
+ -- call('XdoTests', 'c')
+ feed(":call XdoTests('c')<CR><C-l>")
+ expected_empty()
+ end)
+
+ it('works for :cfdo', function()
+ -- call('XfdoTests', 'c')
+ feed(":call XfdoTests('c')<CR><C-l>")
+ expected_empty()
+ end)
+
+ it('works for :ldo', function()
+ -- call('XdoTests', 'l')
+ feed(":call XdoTests('l')<CR><C-l>")
+ expected_empty()
+ end)
+
+ it('works for :lfdo', function()
+ -- call('XfdoTests', 'l')
+ feed(":call XfdoTests('l')<CR><C-l>")
+ expected_empty()
+ end)
+end)
diff --git a/test/functional/legacy/mapping_spec.lua b/test/functional/legacy/mapping_spec.lua
index 3f86ec60de..a0d19926cb 100644
--- a/test/functional/legacy/mapping_spec.lua
+++ b/test/functional/legacy/mapping_spec.lua
@@ -84,6 +84,23 @@ describe('mapping', function()
+]])
end)
+ it('feedkeys', function()
+ insert([[
+ a b c d
+ a b c d
+ ]])
+
+ -- Vim's issue #212 (feedkeys insert mapping at current position)
+ execute('nnoremap . :call feedkeys(".", "in")<cr>')
+ feed('/^a b<cr>')
+ feed('0qqdw.ifoo<esc>qj0@q<esc>')
+ execute('unmap .')
+ expect([[
+ fooc d
+ fooc d
+ ]])
+ end)
+
it('i_CTRL-G_U', function()
-- <c-g>U<cursor> works only within a single line
execute('imapclear')
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua
index 30f37a7463..b3992c4a89 100644
--- a/test/functional/ui/mouse_spec.lua
+++ b/test/functional/ui/mouse_spec.lua
@@ -14,6 +14,7 @@ describe('Mouse input', function()
before_each(function()
clear()
nvim('set_option', 'mouse', 'a')
+ nvim('set_option', 'listchars', 'eol:$')
-- set mouset to very high value to ensure that even in valgrind/travis,
-- nvim will still pick multiple clicks
nvim('set_option', 'mouset', 5000)
diff --git a/test/includes/pre/sys/fcntl.h b/test/includes/pre/fcntl.h
index 767c97a631..9c50ed5b1d 100644
--- a/test/includes/pre/sys/fcntl.h
+++ b/test/includes/pre/fcntl.h
@@ -1,4 +1,4 @@
-#include <sys/fcntl.h>
+#include <fcntl.h>
static const mode_t kO_RDONLY = O_RDONLY;
static const mode_t kO_WRONLY = O_WRONLY;
diff --git a/test/unit/os/env_spec.lua b/test/unit/os/env_spec.lua
index e0e12a24f2..9e00a3e8f8 100644
--- a/test/unit/os/env_spec.lua
+++ b/test/unit/os/env_spec.lua
@@ -148,8 +148,8 @@ describe('env function', function()
local name = 'NEOVIM_UNIT_TEST_EXPAND_ENV_ESCN'
local value = 'NEOVIM_UNIT_TEST_EXPAND_ENV_ESCV'
os_setenv(name, value, 1)
- -- TODO(bobtwinkles) This only tests UNIX expansions. There should be a
- -- test for windows as well
+ -- TODO(bobtwinkles) This only tests Unix expansions. There should be a
+ -- test for Windows as well
local input1 = to_cstr('$NEOVIM_UNIT_TEST_EXPAND_ENV_ESCN/test')
local input2 = to_cstr('${NEOVIM_UNIT_TEST_EXPAND_ENV_ESCN}/test')
local output_buff1 = cstr(255, '')
diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua
index 95c98f18a1..2f393d353d 100644
--- a/test/unit/os/fs_spec.lua
+++ b/test/unit/os/fs_spec.lua
@@ -22,7 +22,7 @@ cimport('./src/nvim/main.h')
cimport('./src/nvim/fileio.h')
local fs = cimport('./src/nvim/os/os.h')
cppimport('sys/stat.h')
-cppimport('sys/fcntl.h')
+cppimport('fcntl.h')
cppimport('uv-errno.h')
local buffer = ""