diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-02-03 12:47:12 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-02-11 19:03:27 +0100 |
commit | 4b7f7be3018563905d55197b43707ebe4ca12e78 (patch) | |
tree | cb0d71763960ac7e438cfdec400dbb6ebf86834b | |
parent | 9b6ed6c71ca0c5573e36bd35bb5c906fdc3e0269 (diff) | |
download | rneovim-4b7f7be3018563905d55197b43707ebe4ca12e78.tar.gz rneovim-4b7f7be3018563905d55197b43707ebe4ca12e78.tar.bz2 rneovim-4b7f7be3018563905d55197b43707ebe4ca12e78.zip |
test: port Test_edit_08() to Lua test
Test_edit_08() depends on special-case handling in has_compl_option()
and redrawing() which are in Vim but are not wanted in Nvim. Using a Lua
test instead of depending on workarounds in the core to make the VimL
test work.
-rw-r--r-- | src/nvim/testdir/test_edit.vim | 1 | ||||
-rw-r--r-- | test/functional/legacy/edit_spec.lua | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim index ba9462c5f5..de1426ca42 100644 --- a/src/nvim/testdir/test_edit.vim +++ b/src/nvim/testdir/test_edit.vim @@ -217,6 +217,7 @@ func! Test_edit_07() endfunc func! Test_edit_08() + throw 'skipped: moved to test/functional/legacy/edit_spec.lua' " reset insertmode from i_ctrl-r_= new call setline(1, ['abc']) diff --git a/test/functional/legacy/edit_spec.lua b/test/functional/legacy/edit_spec.lua new file mode 100644 index 0000000000..91d602924c --- /dev/null +++ b/test/functional/legacy/edit_spec.lua @@ -0,0 +1,25 @@ +-- Test for edit functions +-- See also: src/nvim/testdir/test_edit.vim + +local helpers = require('test.functional.helpers')(after_each) +local source = helpers.source +local eq, eval = helpers.eq, helpers.eval +local funcs = helpers.funcs +local clear = helpers.clear + +describe('edit', function() + before_each(clear) + + it('reset insertmode from i_ctrl-r_=', function() + source([=[ + call setline(1, ['abc']) + call cursor(1, 4) + call feedkeys(":set im\<cr>ZZZ\<c-r>=setbufvar(1,'&im', 0)\<cr>",'tnix') + ]=]) + eq({'abZZZc'}, funcs.getline(1,'$')) + eq({0, 1, 1, 0}, funcs.getpos('.')) + eq(0, eval('&im')) + end) + +end) + |