mirror of
https://github.com/neovim/neovim.git
synced 2024-12-21 03:35:02 -07:00
ff470bb853
It is otherwise impossible to determine which test failed sanitizer/valgrind check. test/functional/helpers.lua module return was changed so that tests which do not provide after_each function to get new check will automatically fail.
43 lines
1.1 KiB
Lua
43 lines
1.1 KiB
Lua
-- Test for character searches
|
|
|
|
local helpers = require('test.functional.helpers')(after_each)
|
|
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)
|