0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.0619: null dict is not handled like an empty dict

Problem:    Null dict is not handled like an empty dict.
Solution:   Fix the code and add tests. (Yegappan Lakshmanan, closes #5968)
This commit is contained in:
Bram Moolenaar
2020-04-23 13:38:02 +02:00
parent db950e4c03
commit ea04a6e8ba
12 changed files with 128 additions and 27 deletions

View File

@@ -1671,6 +1671,20 @@ func Test_compound_assignment_operators()
call assert_fails('let x .= "f"', 'E734')
let x = !3.14
call assert_equal(0.0, x)
" integer and float operations
let x = 1
let x *= 2.1
call assert_equal(2.1, x)
let x = 1
let x /= 0.25
call assert_equal(4.0, x)
let x = 1
call assert_fails('let x %= 0.25', 'E734:')
let x = 1
call assert_fails('let x .= 0.25', 'E734:')
let x = 1.0
call assert_fails('let x += [1.1]', 'E734:')
endif
" Test for environment variable
@@ -1871,6 +1885,9 @@ func Test_missing_end()
" Missing 'in' in a :for statement
call assert_fails('for i range(1) | endfor', 'E690:')
" Incorrect number of variables in for
call assert_fails('for [i,] in range(3) | endfor', 'E475:')
endfunc
" Test for deep nesting of if/for/while/try statements {{{1