patch 8.2.3898: Vim9: not sufficient testing for variable initialization

Problem:    Vim9: not sufficient testing for variable initialization.
Solution:   Add another test case.
This commit is contained in:
Bram Moolenaar
2021-12-25 22:00:49 +00:00
parent 1802405d71
commit fb9dcb080b
2 changed files with 20 additions and 0 deletions

View File

@ -1802,6 +1802,24 @@ def Test_disassemble_return_bool()
assert_equal(true, InvertBool())
enddef
def AutoInit()
var t: number
t = 1
t = 0
enddef
def Test_disassemble_auto_init()
var instr = execute('disassemble AutoInit')
assert_match('AutoInit\_s*' ..
'var t: number\_s*' ..
't = 1\_s*' ..
'\d STORE 1 in $0\_s*' ..
't = 0\_s*' ..
'\d STORE 0 in $0\_s*' ..
'\d\+ RETURN void',
instr)
enddef
def Test_disassemble_compare()
var cases = [
['true == isFalse', 'COMPAREBOOL =='],

View File

@ -749,6 +749,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3898,
/**/
3897,
/**/