diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-07-14 18:15:31 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-14 18:15:31 +0800 |
| commit | c6f0be116ec7481f16341552940764a1f3c6d1c7 (patch) | |
| tree | 22837cb423804c7d9ac5c3cd80aa2932540865c2 /src/nvim/testdir/test_edit.vim | |
| parent | b81d1eb26502f403574113385a75444f8880828e (diff) | |
| parent | 314f1a7c2168ee7e99e2d2b348146df092341a64 (diff) | |
| download | rneovim-c6f0be116ec7481f16341552940764a1f3c6d1c7.tar.gz rneovim-c6f0be116ec7481f16341552940764a1f3c6d1c7.tar.bz2 rneovim-c6f0be116ec7481f16341552940764a1f3c6d1c7.zip | |
Merge pull request #19353 from zeertzjq/vim-8.2.0369
vim-patch:8.2.{0342,0347,0369}: insufficient test coverage
Diffstat (limited to 'src/nvim/testdir/test_edit.vim')
| -rw-r--r-- | src/nvim/testdir/test_edit.vim | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim index 3ae9163861..ed68bb0f73 100644 --- a/src/nvim/testdir/test_edit.vim +++ b/src/nvim/testdir/test_edit.vim @@ -286,7 +286,7 @@ func Test_edit_11() call cursor(2, 1) call feedkeys("i\<c-f>int c;\<esc>", 'tnix') call cursor(3, 1) - call feedkeys("i/* comment */", 'tnix') + call feedkeys("\<Insert>/* comment */", 'tnix') call assert_equal(['{', "\<tab>int c;", "/* comment */"], getline(1, '$')) " added changed cindentkeys slightly set cindent cinkeys+=*/ @@ -1653,6 +1653,39 @@ func Test_edit_noesckeys() " set esckeys endfunc +" Test for running an invalid ex command in insert mode using CTRL-O +" Note that vim has a hard-coded sleep of 3 seconds. So this test will take +" more than 3 seconds to complete. +func Test_edit_ctrl_o_invalid_cmd() + new + set showmode showcmd + let caught_e492 = 0 + try + call feedkeys("i\<C-O>:invalid\<CR>abc\<Esc>", "xt") + catch /E492:/ + let caught_e492 = 1 + endtry + call assert_equal(1, caught_e492) + call assert_equal('abc', getline(1)) + set showmode& showcmd& + close! +endfunc + +" Test for inserting text at the beginning of a line +func Test_insert_before_first_nonblank() + throw 'Skipped: Nvim does not support cpoptions flag "H"' + new + call setline(1, ' ') + normal! Ia + call assert_equal(' a', getline(1)) + set cpo+=H + call setline(1, ' ') + normal! Ia + call assert_equal(' a ', getline(1)) + set cpo-=H + close! +endfunc + " Test for editing a directory func Test_edit_is_a_directory() CheckEnglish |