mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.2.2808: Vim9: increment and decrement not sufficiently tested
Problem: Vim9: increment and decrement not sufficiently tested. Solution: Add assertions.
This commit is contained in:
@@ -1841,14 +1841,20 @@ def Test_inc_dec()
|
||||
var lines =<< trim END
|
||||
var nr = 7
|
||||
++nr
|
||||
echo nr
|
||||
assert_equal(8, nr)
|
||||
--nr
|
||||
echo nr
|
||||
assert_equal(7, nr)
|
||||
|
||||
var ll = [1, 2]
|
||||
--ll[0]
|
||||
++ll[1]
|
||||
echo ll
|
||||
assert_equal([0, 3], ll)
|
||||
|
||||
g:count = 1
|
||||
++g:count
|
||||
--g:count
|
||||
assert_equal(1, g:count)
|
||||
unlet g:count
|
||||
END
|
||||
CheckDefAndScriptSuccess(lines)
|
||||
enddef
|
||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2808,
|
||||
/**/
|
||||
2807,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user