aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_ex_mode.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_ex_mode.vim')
-rw-r--r--src/nvim/testdir/test_ex_mode.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_ex_mode.vim b/src/nvim/testdir/test_ex_mode.vim
index f70cb261e0..1c645ad0f8 100644
--- a/src/nvim/testdir/test_ex_mode.vim
+++ b/src/nvim/testdir/test_ex_mode.vim
@@ -1,5 +1,8 @@
" Test editing line in Ex mode (see :help Q and :help gQ).
+source check.vim
+source shared.vim
+
" Helper function to test editing line in Q Ex mode
func Ex_Q(cmd)
" Is there a simpler way to test editing Ex line?
@@ -79,4 +82,20 @@ func Test_ex_mode_errors()
quit
endfunc
+func Test_ex_mode_count_overflow()
+ " this used to cause a crash
+ let lines =<< trim END
+ call feedkeys("\<Esc>Q\<CR>")
+ v9|9silent! vi|333333233333y32333333%O
+ call writefile(['done'], 'Xdidexmode')
+ qall!
+ END
+ call writefile(lines, 'Xexmodescript')
+ call assert_equal(1, RunVim([], [], '-e -s -S Xexmodescript -c qa'))
+ call assert_equal(['done'], readfile('Xdidexmode'))
+
+ call delete('Xdidexmode')
+ call delete('Xexmodescript')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab