mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 14:56:08 +00:00
test(old): emulate test_override('char_avail') using FFI
Add a non-static variable for this, otherwise it'll be really hacky.
This avoid having to rewrite many incsearch tests in Lua.
(cherry picked from commit c925e7b8ba
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
f0f163b267
commit
d1214da08f
@@ -2519,10 +2519,9 @@ endfunc
|
||||
|
||||
" Test TextChangedI and TextChangedP
|
||||
func Test_ChangedP()
|
||||
throw 'Skipped: use test/functional/autocmd/textchanged_spec.lua'
|
||||
new
|
||||
call setline(1, ['foo', 'bar', 'foobar'])
|
||||
call test_override("char_avail", 1)
|
||||
call Ntest_override("char_avail", 1)
|
||||
set complete=. completeopt=menuone
|
||||
|
||||
func! TextChangedAutocmd(char)
|
||||
@@ -2563,7 +2562,7 @@ func Test_ChangedP()
|
||||
" TODO: how should it handle completeopt=noinsert,noselect?
|
||||
|
||||
" CleanUp
|
||||
call test_override("char_avail", 0)
|
||||
call Ntest_override("char_avail", 0)
|
||||
au! TextChanged
|
||||
au! TextChangedI
|
||||
au! TextChangedP
|
||||
@@ -2583,9 +2582,8 @@ func SetLineOne()
|
||||
endfunc
|
||||
|
||||
func Test_TextChangedI_with_setline()
|
||||
throw 'Skipped: use test/functional/autocmd/textchanged_spec.lua'
|
||||
new
|
||||
call test_override('char_avail', 1)
|
||||
call Ntest_override('char_avail', 1)
|
||||
autocmd TextChangedI <buffer> call SetLineOne()
|
||||
call feedkeys("i(\<CR>\<Esc>", 'tx')
|
||||
call assert_equal('(', getline(1))
|
||||
@@ -2594,7 +2592,7 @@ func Test_TextChangedI_with_setline()
|
||||
call assert_equal('', getline(1))
|
||||
call assert_equal('', getline(2))
|
||||
|
||||
call test_override('char_avail', 0)
|
||||
call Ntest_override('char_avail', 0)
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
|
Reference in New Issue
Block a user