mirror of
https://github.com/vim/vim.git
synced 2025-10-03 05:14:07 -04:00
patch 8.2.2013: Vim9: not skipping white space after unary minus
Problem: Vim9: not skipping white space after unary minus. Solution: Skip whitespace. (closes #7324)
This commit is contained in:
@@ -2300,12 +2300,29 @@ def Test_expr7_parens_vim9script()
|
||||
CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_expr7_negate()
|
||||
def Test_expr7_negate_add()
|
||||
assert_equal(-99, -99)
|
||||
assert_equal(-99, - 99)
|
||||
assert_equal(99, --99)
|
||||
assert_equal(99, -- 99)
|
||||
assert_equal(99, - - 99)
|
||||
assert_equal(99, +99)
|
||||
assert_equal(-99, -+99)
|
||||
assert_equal(-99, -+ 99)
|
||||
assert_equal(-99, - +99)
|
||||
assert_equal(-99, - + 99)
|
||||
assert_equal(-99, +-99)
|
||||
assert_equal(-99, + -99)
|
||||
assert_equal(-99, + - 99)
|
||||
|
||||
var nr = 88
|
||||
assert_equal(-88, -nr)
|
||||
assert_equal(88, --nr)
|
||||
assert_equal(-88, - nr)
|
||||
assert_equal(-88, - +nr)
|
||||
assert_equal(88, -- nr)
|
||||
assert_equal(88, + nr)
|
||||
assert_equal(88, --+ nr)
|
||||
assert_equal(88, - - nr)
|
||||
enddef
|
||||
|
||||
def Echo(arg: any): string
|
||||
|
Reference in New Issue
Block a user