mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
Merge #4249 'tests: migrate charsearch'
This commit is contained in:
@@ -25,7 +25,6 @@ SCRIPTS := \
|
||||
test88.out \
|
||||
test_listlbr.out \
|
||||
test_breakindent.out \
|
||||
test_charsearch.out \
|
||||
test_close_count.out \
|
||||
test_marks.out \
|
||||
test_match_conceal.out \
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
Test for character searches
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:" check that "fe" and ";" work
|
||||
/^X
|
||||
ylfep;;p,,p:
|
||||
:" check that save/restore works
|
||||
/^Y
|
||||
ylfep:let csave = getcharsearch()
|
||||
fip:call setcharsearch(csave)
|
||||
;p;p:
|
||||
:" check that setcharsearch() changes the settins.
|
||||
/^Z
|
||||
ylfep:call setcharsearch({'char': 'k'})
|
||||
;p:call setcharsearch({'forward': 0})
|
||||
$;p:call setcharseearch({'until'}: 1})
|
||||
;;p:
|
||||
:/^X/,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
Xabcdefghijkemnopqretuvwxyz
|
||||
Yabcdefghijkemnopqretuvwxyz
|
||||
Zabcdefghijkemnokqretkvwxyz
|
||||
@@ -1,3 +0,0 @@
|
||||
XabcdeXfghijkeXmnopqreXtuvwxyz
|
||||
YabcdeYfghiYjkeYmnopqreYtuvwxyz
|
||||
ZabcdeZfghijkZemnokZqretkZvwxyz
|
||||
@@ -69,6 +69,8 @@ static char *features[] = {
|
||||
|
||||
// clang-format off
|
||||
static int included_patches[] = {
|
||||
1366,
|
||||
|
||||
// 1219 NA
|
||||
// 1218 NA
|
||||
// 1217 NA
|
||||
@@ -247,7 +249,7 @@ static int included_patches[] = {
|
||||
// 1044 NA,
|
||||
// 1043 NA,
|
||||
// 1042,
|
||||
// 1041,
|
||||
1041,
|
||||
// 1040 NA,
|
||||
// 1039,
|
||||
// 1038 NA,
|
||||
|
||||
42
test/functional/legacy/charsearch_spec.lua
Normal file
42
test/functional/legacy/charsearch_spec.lua
Normal file
@@ -0,0 +1,42 @@
|
||||
-- Test for character searches
|
||||
|
||||
local helpers = require('test.functional.helpers')
|
||||
local feed, insert = helpers.feed, helpers.insert
|
||||
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
|
||||
|
||||
describe('charsearch', function()
|
||||
setup(clear)
|
||||
|
||||
it('is working', function()
|
||||
insert([[
|
||||
Xabcdefghijkemnopqretuvwxyz
|
||||
Yabcdefghijkemnopqretuvwxyz
|
||||
Zabcdefghijkemnokqretkvwxyz]])
|
||||
|
||||
-- Check that "fe" and ";" work.
|
||||
execute('/^X')
|
||||
feed('ylfep;;p,,p')
|
||||
-- Check that save/restore works.
|
||||
execute('/^Y')
|
||||
feed('ylfep')
|
||||
execute('let csave = getcharsearch()')
|
||||
feed('fip')
|
||||
execute('call setcharsearch(csave)')
|
||||
feed(';p;p')
|
||||
-- Check that setcharsearch() changes the settings.
|
||||
execute('/^Z')
|
||||
feed('ylfep')
|
||||
execute("call setcharsearch({'char': 'k'})")
|
||||
feed(';p')
|
||||
execute("call setcharsearch({'forward': 0})")
|
||||
feed('$;p')
|
||||
execute("call setcharsearch({'until': 1})")
|
||||
feed(';;p')
|
||||
|
||||
-- Assert buffer contents.
|
||||
expect([[
|
||||
XabcdeXfghijkeXmnopqreXtuvwxyz
|
||||
YabcdeYfghiYjkeYmnopqreYtuvwxyz
|
||||
ZabcdeZfghijkZZemnokqretkZvwxyz]])
|
||||
end)
|
||||
end)
|
||||
Reference in New Issue
Block a user