11" tests for listener_add() and listener_remove()
22
3- func s: StoreList (s , l )
3+ func s: StoreList (s , e , a , l )
44 let s: start = a: s
5+ let s: end = a: e
6+ let s: added = a: a
57 let s: text = getline (a: s )
68 let s: list = a: l
79endfunc
@@ -19,7 +21,7 @@ func Test_listening()
1921 new
2022 call setline (1 , [' one' , ' two' ])
2123 let s: list = []
22- let id = listener_add ({b , s , e , a , l - > s: StoreList (s , l )})
24+ let id = listener_add ({b , s , e , a , l - > s: StoreList (s , e , a , l )})
2325 call setline (1 , ' one one' )
2426 call listener_flush ()
2527 call assert_equal ([{' lnum' : 1 , ' end' : 2 , ' col' : 1 , ' added' : 0 }], s: list )
@@ -65,6 +67,9 @@ func Test_listening()
6567 call bufnr ()- >listener_flush ()
6668 call assert_equal ([{' lnum' : 3 , ' end' : 3 , ' col' : 1 , ' added' : 1 },
6769 \ {' lnum' : 1 , ' end' : 2 , ' col' : 1 , ' added' : 0 }], s: list )
70+ call assert_equal (1 , s: start )
71+ call assert_equal (3 , s: end )
72+ call assert_equal (1 , s: added )
6873
6974 " an insert just above a previous change that was the last one does not get
7075 " merged
0 commit comments