return v:false
endfunc
+" Command to check for not running under ASAN
+command CheckNotAsan call CheckNotAsan()
+func CheckNotAsan()
+ if execute('version') =~# '-fsanitize=[a-z,]*\<address\>'
+ throw 'Skipped: does not work with ASAN'
+ endif
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
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("\<Esc>Q\<CR>")
call setline(1, ['', 'abcd', ''])
call assert_fails('exe "normal 2G$a\<C-X>\<C-U>"', 'E578:')
- " 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\<C-X>\<C-U>"', '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\<C-X>\<C-U>"', 'E839:')
+ close!
+
+ set completefunc&
+ delfunc CompleteFunc
+endfunc
+
" Test for returning non-string values from 'completefunc'
func Test_completefunc_invalid_data()
new
CheckFeature terminal
CheckNotGui
-if execute('version') =~# '-fsanitize=[a-z,]*\<address\>'
- " Skip tests on Travis CI ASAN build because it's difficult to estimate
- " memory usage.
- throw 'Skipped: does not work with ASAN'
-endif
+" Skip tests on Travis CI ASAN build because it's difficult to estimate memory
+" usage.
+CheckNotAsan
source shared.vim