From b0bbcfa2392a0b6c58274baf5facadda6cdff10a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 17 Jul 2022 12:13:29 +0800 Subject: vim-patch:8.2.2424: some tests are known to cause an error with ASAN Problem: Some tests are known to cause an error with ASAN. Solution: Add CheckNotAsan. https://github.com/vim/vim/commit/97202d951685fc4d90085da676a90644cbf72571 Move CheckNotMSWindows to the right place. Omit test_memory_usage.vim: a Lua test is used for this file. --- src/nvim/testdir/check.vim | 16 +++++++-------- src/nvim/testdir/test_ex_mode.vim | 3 +++ src/nvim/testdir/test_ins_complete.vim | 36 ++++++++++++++++++++-------------- 3 files changed, 32 insertions(+), 23 deletions(-) diff --git a/src/nvim/testdir/check.vim b/src/nvim/testdir/check.vim index 8f97d959ce..4107df99d6 100644 --- a/src/nvim/testdir/check.vim +++ b/src/nvim/testdir/check.vim @@ -55,6 +55,14 @@ func CheckMSWindows() endif endfunc +" Command to check for NOT running on MS-Windows +command CheckNotMSWindows call CheckNotMSWindows() +func CheckNotMSWindows() + if has('win32') + throw 'Skipped: does not work on MS-Windows' + endif +endfunc + " Command to check for running on Unix command CheckUnix call CheckUnix() func CheckUnix() @@ -129,14 +137,6 @@ func CheckEnglish() endif endfunc -" Command to check for NOT running on MS-Windows -command CheckNotMSWindows call CheckNotMSWindows() -func CheckNotMSWindows() - if has('win32') - throw 'Skipped: does not work on MS-Windows' - endif -endfunc - " Command to check for not running under ASAN command CheckNotAsan call CheckNotAsan() func CheckNotAsan() diff --git a/src/nvim/testdir/test_ex_mode.vim b/src/nvim/testdir/test_ex_mode.vim index b478332c79..122572f32a 100644 --- a/src/nvim/testdir/test_ex_mode.vim +++ b/src/nvim/testdir/test_ex_mode.vim @@ -191,6 +191,9 @@ func Test_ex_mode_errors() endfunc func Test_ex_mode_count_overflow() + " The multiplication causes an integer overflow + CheckNotAsan + " this used to cause a crash let lines =<< trim END call feedkeys("\gQ\") diff --git a/src/nvim/testdir/test_ins_complete.vim b/src/nvim/testdir/test_ins_complete.vim index 4fcf35c00f..532685b9de 100644 --- a/src/nvim/testdir/test_ins_complete.vim +++ b/src/nvim/testdir/test_ins_complete.vim @@ -628,27 +628,33 @@ func Test_completefunc_error() call setline(1, ['', 'abcd', '']) call assert_fails('exe "normal 2G$a\\"', 'E565:') - " Jump to a different window from the complete function - " TODO: The following test causes an ASAN failure. Once this issue is - " addressed, enable the following test. - "func! CompleteFunc(findstart, base) - " if a:findstart == 1 - " return col('.') - 1 - " endif - " wincmd p - " return ['a', 'b'] - "endfunc - "set completefunc=CompleteFunc - "new - "call assert_fails('exe "normal a\\"', 'E839:') - "close! - set completefunc& delfunc CompleteFunc delfunc CompleteFunc2 close! endfunc +func Test_completefunc_error_not_asan() + " The following test causes an ASAN failure. + CheckNotAsan + + " Jump to a different window from the complete function + func! CompleteFunc(findstart, base) + if a:findstart == 1 + return col('.') - 1 + endif + wincmd p + return ['a', 'b'] + endfunc + set completefunc=CompleteFunc + new + call assert_fails('exe "normal a\\"', 'E839:') + close! + + set completefunc& + delfunc CompleteFunc +endfunc + " Test for returning non-string values from 'completefunc' func Test_completefunc_invalid_data() new -- cgit