summaryrefslogtreecommitdiff
path: root/src/testdir/test_jumplist.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-02-12 22:15:06 +0100
committerBram Moolenaar <Bram@vim.org>2019-02-12 22:15:06 +0100
commit57ee2b6e0b5b730d12ee9db00a8e2a577df9e374 (patch)
tree7a464fd4a90cd0a52e0329bb01aea5280b27ac7a /src/testdir/test_jumplist.vim
parent48773f1f83e666c49b9d88ea6a392d50215ca013 (diff)
downloadvim-git-57ee2b6e0b5b730d12ee9db00a8e2a577df9e374.tar.gz
patch 8.1.0901: index in getjumplist() may be wrongv8.1.0901
Problem: Index in getjumplist() may be wrong. (Epheien) Solution: Call cleanup_jumplist() earlier. (Yegappan Lakshmanan, closes #3941)
Diffstat (limited to 'src/testdir/test_jumplist.vim')
-rw-r--r--src/testdir/test_jumplist.vim16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/testdir/test_jumplist.vim b/src/testdir/test_jumplist.vim
index 02dbd7619..be1af5e70 100644
--- a/src/testdir/test_jumplist.vim
+++ b/src/testdir/test_jumplist.vim
@@ -28,11 +28,13 @@ func Test_getjumplist()
normal G
normal gg
- call assert_equal([[
+ let expected = [[
\ {'lnum': 1, 'bufnr': bnr, 'col': 0, 'coladd': 0},
\ {'lnum': 50, 'bufnr': bnr, 'col': 0, 'coladd': 0},
- \ {'lnum': 100, 'bufnr': bnr, 'col': 0, 'coladd': 0}], 4],
- \ getjumplist())
+ \ {'lnum': 100, 'bufnr': bnr, 'col': 0, 'coladd': 0}], 3]
+ call assert_equal(expected, getjumplist())
+ " jumplist doesn't change in between calls
+ call assert_equal(expected, getjumplist())
" Traverse the jump list and verify the results
5
@@ -44,12 +46,14 @@ func Test_getjumplist()
call assert_equal(3, getjumplist()[1])
exe "normal \<C-O>"
normal 20%
- call assert_equal([[
+ let expected = [[
\ {'lnum': 1, 'bufnr': bnr, 'col': 0, 'coladd': 0},
\ {'lnum': 50, 'bufnr': bnr, 'col': 0, 'coladd': 0},
\ {'lnum': 5, 'bufnr': bnr, 'col': 0, 'coladd': 0},
- \ {'lnum': 100, 'bufnr': bnr, 'col': 0, 'coladd': 0}], 5],
- \ getjumplist())
+ \ {'lnum': 100, 'bufnr': bnr, 'col': 0, 'coladd': 0}], 4]
+ call assert_equal(expected, getjumplist())
+ " jumplist doesn't change in between calls
+ call assert_equal(expected, getjumplist())
let l = getjumplist()
call test_garbagecollect_now()