aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_assert.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_assert.vim')
-rw-r--r--src/nvim/testdir/test_assert.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_assert.vim b/src/nvim/testdir/test_assert.vim
index 28c5948142..9d0d5b3e70 100644
--- a/src/nvim/testdir/test_assert.vim
+++ b/src/nvim/testdir/test_assert.vim
@@ -257,6 +257,26 @@ func Test_assert_with_msg()
call remove(v:errors, 0)
endfunc
+func Test_mouse_position()
+ throw 'Skipped: Nvim does not have test_setmouse()'
+ let save_mouse = &mouse
+ set mouse=a
+ new
+ call setline(1, ['line one', 'line two'])
+ call assert_equal([0, 1, 1, 0], getpos('.'))
+ call test_setmouse(1, 5)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 1, 5, 0], getpos('.'))
+ call test_setmouse(2, 20)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 2, 8, 0], getpos('.'))
+ call test_setmouse(5, 1)
+ call feedkeys("\<LeftMouse>", "xt")
+ call assert_equal([0, 2, 1, 0], getpos('.'))
+ bwipe!
+ let &mouse = save_mouse
+endfunc
+
" Must be last.
func Test_zz_quit_detected()
" Verify that if a test function ends Vim the test script detects this.