From 0301de758ba90139a4af9edc3993ef438a4d4cd1 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 31 Dec 2019 23:15:42 -0500 Subject: vim-patch:8.1.1346: error for Python exception does not show useful info Problem: Error for Python exception does not show useful info. Solution: Show the last line instead of the first one. (Ben Jackson, closes vim/vim#4381) https://github.com/vim/vim/commit/7f3a28490abb7c495239fc438825e3d1aaafa76d --- src/nvim/testdir/test_python2.vim | 8 ++++++++ src/nvim/testdir/test_python3.vim | 8 ++++++++ src/nvim/testdir/test_pyx2.vim | 8 ++++++++ src/nvim/testdir/test_pyx3.vim | 8 ++++++++ 4 files changed, 32 insertions(+) (limited to 'src') diff --git a/src/nvim/testdir/test_python2.vim b/src/nvim/testdir/test_python2.vim index 8d55b59c31..9628a298b9 100644 --- a/src/nvim/testdir/test_python2.vim +++ b/src/nvim/testdir/test_python2.vim @@ -164,3 +164,11 @@ func Test_Write_To_Current_Buffer_Fixes_Cursor_Str() bwipe! endfunction + +func Test_Catch_Exception_Message() + try + py raise RuntimeError( 'TEST' ) + catch /.*/ + call assert_match('^Vim(.*):.*RuntimeError: TEST$', v:exception ) + endtry +endfunc diff --git a/src/nvim/testdir/test_python3.vim b/src/nvim/testdir/test_python3.vim index cd07b0883f..e64a8fcc47 100644 --- a/src/nvim/testdir/test_python3.vim +++ b/src/nvim/testdir/test_python3.vim @@ -164,3 +164,11 @@ func Test_Write_To_Current_Buffer_Fixes_Cursor_Str() bwipe! endfunction + +func Test_Catch_Exception_Message() + try + py3 raise RuntimeError( 'TEST' ) + catch /.*/ + call assert_match('^Vim(.*):.*RuntimeError: TEST$', v:exception ) + endtry +endfunc diff --git a/src/nvim/testdir/test_pyx2.vim b/src/nvim/testdir/test_pyx2.vim index 50e57c3bfb..10ff3b6e58 100644 --- a/src/nvim/testdir/test_pyx2.vim +++ b/src/nvim/testdir/test_pyx2.vim @@ -72,3 +72,11 @@ func Test_pyxfile() call assert_match(s:py3pattern, split(var)[0]) endif endfunc + +func Test_Catch_Exception_Message() + try + pyx raise RuntimeError( 'TEST' ) + catch /.*/ + call assert_match('^Vim(.*):.*RuntimeError: TEST$', v:exception ) + endtry +endfunc diff --git a/src/nvim/testdir/test_pyx3.vim b/src/nvim/testdir/test_pyx3.vim index 64546b4688..2044af3abe 100644 --- a/src/nvim/testdir/test_pyx3.vim +++ b/src/nvim/testdir/test_pyx3.vim @@ -72,3 +72,11 @@ func Test_pyxfile() call assert_match(s:py2pattern, split(var)[0]) endif endfunc + +func Test_Catch_Exception_Message() + try + pyx raise RuntimeError( 'TEST' ) + catch /.*/ + call assert_match('^Vim(.*):.*RuntimeError: TEST$', v:exception ) + endtry +endfunc -- cgit From 0f47870d1b5e893857df007901f5f062939a9eb7 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 31 Dec 2019 23:22:58 -0500 Subject: vim-patch:8.2.0068: crash when using Python 3 with "utf32" encoding Problem: Crash when using Python 3 with "utf32" encoding. (Dominique Pelle) Solution: Use "utf-8" whenever enc_utf8 is set. (closes vim/vim#5423) https://github.com/vim/vim/commit/556684ff71e044a642879d759373a7ebc5047fad --- src/nvim/testdir/test_python3.vim | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/nvim/testdir/test_python3.vim b/src/nvim/testdir/test_python3.vim index e64a8fcc47..5268dc9d1e 100644 --- a/src/nvim/testdir/test_python3.vim +++ b/src/nvim/testdir/test_python3.vim @@ -172,3 +172,10 @@ func Test_Catch_Exception_Message() call assert_match('^Vim(.*):.*RuntimeError: TEST$', v:exception ) endtry endfunc + +func Test_unicode() + " this crashed Vim once + " set encoding=utf32 + py3 print('hello') + " set encoding=utf8 +endfunc -- cgit