mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.2.1490: Vim9: using /= with float and number doesn't work
Problem: Vim9: using /= with float and number doesn't work. Solution: Better support assignment with operator. (closes #6742)
This commit is contained in:
@@ -90,6 +90,18 @@ def Test_assignment()
|
||||
&ts %= 4
|
||||
assert_equal(2, &ts)
|
||||
|
||||
if has('float')
|
||||
let f100: float = 100.0
|
||||
f100 /= 5
|
||||
assert_equal(20.0, f100)
|
||||
|
||||
let f200: float = 200.0
|
||||
f200 /= 5.0
|
||||
assert_equal(40.0, f200)
|
||||
|
||||
CheckDefFailure(['let nr: number = 200', 'nr /= 5.0'], 'E1012:')
|
||||
endif
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
&ts = 6
|
||||
|
Reference in New Issue
Block a user