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

patch 8.2.2378: Vim9: no error message for dividing by zero

Problem:    Vim9: no error message for dividing by zero.
Solution:   Give an error message. (issue #7704)
This commit is contained in:
Bram Moolenaar
2021-01-20 21:23:14 +01:00
parent a28639e711
commit 99880f96cf
5 changed files with 20 additions and 6 deletions

View File

@@ -1376,7 +1376,6 @@ def Test_expr6()
assert_equal(1, g:anint / 6)
assert_equal(2, g:anint
/ g:thefour)
assert_true(1 / 0 > 99999)
assert_equal(5, 11 % 6)
assert_equal(4, g:anint % 6)
@@ -1384,7 +1383,6 @@ def Test_expr6()
g:anint)
assert_equal(2, g:anint
% g:thefour)
assert_equal(0, 1 % 0)
assert_equal(4, 6 * 4 / 6)
@@ -1405,6 +1403,9 @@ def Test_expr6()
CheckDefFailure(["var x = 6 * xxx"], 'E1001:', 1)
CheckDefFailure(["var d = 6 * "], 'E1097:', 3)
CheckDefExecAndScriptFailure(['echo 1 / 0'], 'E1154', 1)
CheckDefExecAndScriptFailure(['echo 1 % 0'], 'E1154', 1)
enddef
def Test_expr6_vim9script()