1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
Description: Relax assert of cursor pos tests failing with newer vim
The difference is one point, so this seems hardly relevant in
practical terms as the test is more there to check the cursor
isn't completely off.
.
Upstream tests with a specific version and will just change the
tests accordingly as needed as usual, so forwarding is pointless.
We could do that as well, but to avoid a transition complicating
hard-dependency on a specific vim version, we just accept both.
.
Closes: #1120056
Author: David Kalnischkies <donkult@debian.org>
Forwarded: not-needed
--- a/test/finder.test.vim
+++ b/test/finder.test.vim
@@ -50,7 +50,13 @@
call WaitForAssert( { -> assert_equal( l, winlayout() ) } )
call WaitForAssert( { -> assert_equal( original_win, winnr() ) } )
call assert_equal( b, bufnr() )
- call assert_equal( [ 0, 5, 7, 0 ], getpos( '.' ) )
+
+ let p = getpos( '.' )
+ if p[2] == 7
+ call assert_equal( [ 0, 5, 7, 0 ], p )
+ else
+ call assert_equal( [ 0, 5, 6, 0 ], p )
+ endif
delfunct PutQuery
delfunct SelectItem
@@ -100,7 +106,12 @@
call assert_equal( b, bufnr() )
" NOTE: cland returns the position of the decl here not the identifier. This
" is why it's position 3 not 7 as in the Test_WorkspaceSymbol_Basic
- call assert_equal( [ 0, 5, 3, 0 ], getpos( '.' ) )
+ let p = getpos( '.' )
+ if p[2] == 3
+ call assert_equal( [ 0, 5, 3, 0 ], p )
+ else
+ call assert_equal( [ 0, 5, 2, 0 ], p )
+ endif
delfunct PutQuery
delfunct SelectItem
@@ -332,7 +343,13 @@
call WaitForAssert( { -> assert_equal( l, winlayout() ) } )
call WaitForAssert( { -> assert_equal( original_win, winnr() ) } )
call assert_equal( b, bufnr() )
- call assert_equal( [ 0, 5, 30, 0 ], getpos( '.' ) )
+
+ let p = getpos( '.' )
+ if p[2] == 30
+ call assert_equal( [ 0, 5, 30, 0 ], p )
+ else
+ call assert_equal( [ 0, 5, 29, 0 ], p )
+ endif
" We pop up a notification with some text in it
if exists( '*popup_list' )
@@ -468,7 +485,13 @@
call WaitForAssert( { -> assert_equal( l, winlayout() ) } )
call WaitForAssert( { -> assert_equal( original_win, winnr() ) } )
call assert_equal( b, bufnr() )
- call assert_equal( [ 0, 5, 7, 0 ], getpos( '.' ) )
+
+ let p = getpos( '.' )
+ if p[2] == 7
+ call assert_equal( [ 0, 5, 7, 0 ], p )
+ else
+ call assert_equal( [ 0, 5, 6, 0 ], p )
+ endif
call test_override( 'ALL', 0 )
silent %bwipe!
|