0
0
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:
Bram Moolenaar
2021-04-24 20:43:56 +02:00
parent 340c59ec6f
commit 730bf30020
2 changed files with 11 additions and 3 deletions

View File

@@ -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

View File

@@ -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,
/**/ /**/