summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_expr.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-10-20 14:17:18 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-20 14:17:18 +0100
commitcdef1cefa2a440911c727558562f83ed9b00e16b (patch)
treeaf1594f84e5951aa45d9f4abad902a616bcd6a1d /src/testdir/test_expr.vim
parent43625762a9751cc6e6e4d8f54fbc8b82d98fb20d (diff)
patch 9.0.0804: crash when trying to divide a number by -1v9.0.0804
Problem: Crash when trying to divice the largest negative number by -1. Solution: Handle this case specifically.
Diffstat (limited to 'src/testdir/test_expr.vim')
-rw-r--r--src/testdir/test_expr.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim
index b47896340f..e1fed369b7 100644
--- a/src/testdir/test_expr.vim
+++ b/src/testdir/test_expr.vim
@@ -761,6 +761,12 @@ func Test_eval_after_if()
call assert_equal('b', s:val)
endfunc
+func Test_divide_by_zero()
+ " only tests that this doesn't crash, the result is not important
+ echo 0 / 0
+ echo 0 / 0 / -1
+endfunc
+
" Test for command-line completion of expressions
func Test_expr_completion()
CheckFeature cmdline_compl