patch 8.2.1040: not enough testing for movement commands
Problem: Not enough testing for movement commands.
Solution: Add more tests. (Yegappan Lakshmanan, closes #6313)
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim
index d18b15f..a57f3c7 100644
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -513,6 +513,7 @@
endfunc
func Test_set_values()
+ " opt_test.vim is generated from ../optiondefs.h using gen_opt_test.vim
if filereadable('opt_test.vim')
source opt_test.vim
else
@@ -921,4 +922,35 @@
set number&
endfunc
+" Test for the 'window' option
+func Test_window_opt()
+ " Needs only one open widow
+ %bw!
+ call setline(1, range(1, 8))
+ set window=5
+ exe "normal \<C-F>"
+ call assert_equal(4, line('w0'))
+ exe "normal \<C-F>"
+ call assert_equal(7, line('w0'))
+ exe "normal \<C-F>"
+ call assert_equal(8, line('w0'))
+ exe "normal \<C-B>"
+ call assert_equal(5, line('w0'))
+ exe "normal \<C-B>"
+ call assert_equal(2, line('w0'))
+ exe "normal \<C-B>"
+ call assert_equal(1, line('w0'))
+ set window=1
+ exe "normal gg\<C-F>"
+ call assert_equal(2, line('w0'))
+ exe "normal \<C-F>"
+ call assert_equal(3, line('w0'))
+ exe "normal \<C-B>"
+ call assert_equal(2, line('w0'))
+ exe "normal \<C-B>"
+ call assert_equal(1, line('w0'))
+ enew!
+ set window&
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab