0
0
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:
Bram Moolenaar
2020-11-18 17:39:05 +01:00
parent d92cc130fb
commit 79cdf80bed
3 changed files with 23 additions and 2 deletions

View File

@@ -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