0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

patch 8.2.0486: Vim9: some code and error messages not tested

Problem:    Vim9: some code and error messages not tested.
Solution:   Add more tests.
This commit is contained in:
Bram Moolenaar
2020-03-30 22:51:24 +02:00
parent 01b3862956
commit 9be61bbb17
5 changed files with 60 additions and 7 deletions

View File

@@ -58,6 +58,7 @@ enddef
func Test_expr1_fails()
call CheckDefFailure("let x = 1 ? 'one'", "Missing ':' after '?'")
call CheckDefFailure("let x = 1 ? 'one' : xxx", "E1001:")
let msg = "white space required before and after '?'"
call CheckDefFailure("let x = 1? 'one' : 'two'", msg)
@@ -192,11 +193,18 @@ def Test_expr4_equal()
assert_equal(true, g:astring == 'asdf')
assert_equal(false, 'xyz' == g:astring)
assert_equal(false, 'abc' == 'aBc')
assert_equal(false, 'abc' ==# 'aBc')
assert_equal(true, 'abc' ==? 'aBc')
assert_equal(false, 'abc' == 'ABC')
set ignorecase
assert_equal(false, 'abc' == 'ABC')
assert_equal(false, 'abc' ==# 'ABC')
set noignorecase
call CheckDefFailure("let x = 'a' == xxx", 'E1001:')
assert_equal(true, 0z3f == 0z3f)
assert_equal(false, 0z3f == 0z4f)
assert_equal(true, g:ablob == 0z01ab)