mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -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 lines =<< trim END
|
||||||
var nr = 7
|
var nr = 7
|
||||||
++nr
|
++nr
|
||||||
echo nr
|
assert_equal(8, nr)
|
||||||
--nr
|
--nr
|
||||||
echo nr
|
assert_equal(7, nr)
|
||||||
|
|
||||||
var ll = [1, 2]
|
var ll = [1, 2]
|
||||||
--ll[0]
|
--ll[0]
|
||||||
++ll[1]
|
++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
|
END
|
||||||
CheckDefAndScriptSuccess(lines)
|
CheckDefAndScriptSuccess(lines)
|
||||||
enddef
|
enddef
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2808,
|
||||||
/**/
|
/**/
|
||||||
2807,
|
2807,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user