diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-01-21 12:34:14 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-01-21 12:34:14 +0100 |
commit | c5f59fab23820454f060562927ddc1397f9d479a (patch) | |
tree | b2f9c295fd9d127e5211ad608966554cf92d7ae6 /src/testdir/test_vim9_assign.vim | |
parent | a0f7f73ebb3ab032af08699c24c465403512b7d8 (diff) | |
download | vim-git-c5f59fab23820454f060562927ddc1397f9d479a.tar.gz |
patch 8.2.2381: Vim9: divide by zero does not abort expression executionv8.2.2381
Problem: Vim9: divide by zero does not abort expression execution.
Solution: Use a "failed" flag. (issue #7704)
Diffstat (limited to 'src/testdir/test_vim9_assign.vim')
-rw-r--r-- | src/testdir/test_vim9_assign.vim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_assign.vim b/src/testdir/test_vim9_assign.vim index 20bdb9138..992eeaa65 100644 --- a/src/testdir/test_vim9_assign.vim +++ b/src/testdir/test_vim9_assign.vim @@ -1489,6 +1489,30 @@ def Test_unlet() assert_equal('', $ENVVAR) enddef +def Test_expr_error_no_assign() + var lines =<< trim END + vim9script + var x = invalid + echo x + END + CheckScriptFailureList(lines, ['E121:', 'E121:']) + + lines =<< trim END + vim9script + var x = 1 / 0 + echo x + END + CheckScriptFailureList(lines, ['E1154:', 'E121:']) + + lines =<< trim END + vim9script + var x = 1 % 0 + echo x + END + CheckScriptFailureList(lines, ['E1154:', 'E121:']) +enddef + + def Test_assign_command_modifier() var lines =<< trim END var verbose = 0 |