From af23d173883f47fd02a9a380c719e4428370b484 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Tue, 7 Mar 2023 04:13:04 +0100 Subject: test: move oldtests to test directory (#22536) The new oldtest directory is in test/old/testdir. The reason for this is that many tests have hardcoded the parent directory name to be 'testdir'. --- test/old/testdir/test_input.vim | 61 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 test/old/testdir/test_input.vim (limited to 'test/old/testdir/test_input.vim') diff --git a/test/old/testdir/test_input.vim b/test/old/testdir/test_input.vim new file mode 100644 index 0000000000..3b1e2eb2df --- /dev/null +++ b/test/old/testdir/test_input.vim @@ -0,0 +1,61 @@ +" Tests for character input and feedkeys() function. + +func Test_feedkeys_x_with_empty_string() + new + call feedkeys("ifoo\") + call assert_equal('', getline('.')) + call feedkeys('', 'x') + call assert_equal('foo', getline('.')) + + " check it goes back to normal mode immediately. + call feedkeys('i', 'x') + call assert_equal('foo', getline('.')) + quit! +endfunc + +func Test_feedkeys_with_abbreviation() + new + inoreabbrev trigger value + call feedkeys("atrigger ", 'x') + call feedkeys("atrigger ", 'x') + call assert_equal('value value ', getline(1)) + bwipe! + iunabbrev trigger +endfunc + +func Test_feedkeys_escape_special() + nnoremap … let g:got_ellipsis += 1 + call feedkeys('…', 't') + call assert_equal('…', getcharstr()) + let g:got_ellipsis = 0 + call feedkeys('…', 'xt') + call assert_equal(1, g:got_ellipsis) + unlet g:got_ellipsis + nunmap … +endfunc + +func Test_input_simplify_ctrl_at() + new + " feeding unsimplified CTRL-@ should still trigger i_CTRL-@ + call feedkeys("ifoo\A\<*C-@>x", 'xt') + call assert_equal('foofo', getline(1)) + bw! +endfunc + +func Test_input_simplify_noremap() + call feedkeys("i\<*C-M>", 'nx') + call assert_equal('', getline(1)) + call assert_equal([0, 2, 1, 0, 1], getcurpos()) + bw! +endfunc + +func Test_input_simplify_timedout() + inoremap a b + call feedkeys("i\<*C-M>", 'xt') + call assert_equal('', getline(1)) + call assert_equal([0, 2, 1, 0, 1], getcurpos()) + iunmap a + bw! +endfunc + +" vim: shiftwidth=2 sts=2 expandtab -- cgit