diff options
| author | Bram Moolenaar <Bram@vim.org> | 2020-07-11 22:14:59 +0200 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2020-07-11 22:14:59 +0200 |
| commit | 9b7bf9e98f06ece595fed7a3ff53ecce89797a53 (patch) | |
| tree | 4a9b2cd5ac2f18f3c2c017530ab95f6878f1e757 /src/testdir/test_python3.vim | |
| parent | 914e7eaa67f8d816e15fb4a1180e6bece88d9742 (diff) | |
| download | vim-git-9b7bf9e98f06ece595fed7a3ff53ecce89797a53.tar.gz | |
patch 8.2.1183: assert_fails() checks the last error messagev8.2.1183
Problem: assert_fails() checks the last error message.
Solution: Check the first error, it is more relevant. Fix all the tests
that rely on the old behavior.
Diffstat (limited to 'src/testdir/test_python3.vim')
| -rw-r--r-- | src/testdir/test_python3.vim | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/testdir/test_python3.vim b/src/testdir/test_python3.vim index 0082751d7..830fbba50 100644 --- a/src/testdir/test_python3.vim +++ b/src/testdir/test_python3.vim @@ -90,7 +90,7 @@ func Test_py3do() " Try modifying a buffer with 'nomodifiable' set set nomodifiable - call assert_fails('py3do toupper(line)', 'cannot save undo information') + call assert_fails('py3do toupper(line)', 'E21:') set modifiable " Invalid command @@ -290,7 +290,7 @@ func Test_python3_vim_val() call assert_equal("\nNone", execute('py3 print(vim.eval("v:none"))')) call assert_equal("\nb'\\xab\\x12'", execute('py3 print(vim.eval("0zab12"))')) - call assert_fails('py3 vim.eval("1+")', 'vim.error: invalid expression') + call assert_fails('py3 vim.eval("1+")', 'E15: Invalid expression') endfunc " Test range objects, see :help python-range @@ -305,10 +305,10 @@ func Test_python3_range() call assert_equal('3', py3eval('b[2]')) call assert_equal('4', py3eval('r[2]')) - call assert_fails('py3 r[3] = "x"', 'IndexError: line number out of range') - call assert_fails('py3 x = r[3]', 'IndexError: line number out of range') - call assert_fails('py3 r["a"] = "x"', 'TypeError: index must be int or slice, not str') - call assert_fails('py3 x = r["a"]', 'TypeError: index must be int or slice, not str') + call assert_fails('py3 r[3] = "x"', ['Traceback', 'IndexError: line number out of range']) + call assert_fails('py3 x = r[3]', ['Traceback', 'IndexError: line number out of range']) + call assert_fails('py3 r["a"] = "x"', ['Traceback', 'TypeError: index must be int or slice, not str']) + call assert_fails('py3 x = r["a"]', ['Traceback', 'TypeError: index must be int or slice, not str']) py3 del r[:] call assert_equal(['1', '5', '6'], getline(1, '$')) |
