aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-05-19 08:44:57 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-05-19 23:15:47 -0400
commit854073f1dbdf6495a589a6d6794fc77d8dbe8741 (patch)
treea4a891f2c33ad08101321ee3b8d352934dc41ec9 /src/nvim/testdir
parent4aad4c053366592f9604ecc6d3a1348005bf2ce7 (diff)
downloadrneovim-854073f1dbdf6495a589a6d6794fc77d8dbe8741.tar.gz
rneovim-854073f1dbdf6495a589a6d6794fc77d8dbe8741.tar.bz2
rneovim-854073f1dbdf6495a589a6d6794fc77d8dbe8741.zip
vim-patch:8.1.0901: index in getjumplist() may be wrong
Problem: Index in getjumplist() may be wrong. (Epheien) Solution: Call cleanup_jumplist() earlier. (Yegappan Lakshmanan, closes vim/vim#3941) https://github.com/vim/vim/commit/57ee2b6e0b5b730d12ee9db00a8e2a577df9e374
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_jumplist.vim16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/nvim/testdir/test_jumplist.vim b/src/nvim/testdir/test_jumplist.vim
index 02dbd76194..be1af5e705 100644
--- a/src/nvim/testdir/test_jumplist.vim
+++ b/src/nvim/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()