neovim/test/functional/legacy/search_mbyte_spec.lua
dundargoc 052498ed42 test: improve test conventions
Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.

Closes https://github.com/neovim/neovim/issues/27004.
2024-04-23 18:17:04 +02:00

32 lines
577 B
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local n = require('test.functional.testnvim')()
local poke_eventloop = n.poke_eventloop
local clear = n.clear
local insert = n.insert
local expect = n.expect
local command = n.command
describe('search_mbyte', function()
before_each(clear)
it("search('multi-byte char', 'bce')", function()
insert([=[
Results:
Test bce:
]=])
poke_eventloop()
command('/^Test bce:/+1')
command([[$put =search('', 'bce', line('.'))]])
-- Assert buffer contents.
expect([=[
Results:
Test bce:
4]=])
end)
end)