1
0
forked from aniani/vim

patch 8.2.4534: Vim9: "is" operator with empty string and null returns true

Problem:    Vim9: "is" operator with empty string and null returns true.
Solution:   Consider empty string and null to be different for "is".
This commit is contained in:
Bram Moolenaar
2022-03-10 12:20:53 +00:00
parent 56b84b1728
commit f8691004b0
4 changed files with 27 additions and 5 deletions

View File

@@ -801,6 +801,13 @@ def Test_expr4_compare_null()
assert_false(null_string != null)
assert_false(v:null != test_null_string())
assert_false(null != null_string)
assert_true(null_string is test_null_string())
assert_false(null_string is '')
assert_false('' is null_string)
assert_false(null_string isnot test_null_string())
assert_true(null_string isnot '')
assert_true('' isnot null_string)
END
v9.CheckDefAndScriptSuccess(lines)
unlet g:null_dict