2016-04-23 16:53:11 -07:00
|
|
|
|
local helpers = require('test.functional.helpers')(after_each)
|
2017-04-08 14:12:26 -07:00
|
|
|
|
|
2020-10-19 11:17:51 -07:00
|
|
|
|
local poke_eventloop = helpers.poke_eventloop
|
2017-04-08 14:12:26 -07:00
|
|
|
|
local clear = helpers.clear
|
2016-02-01 00:53:59 -07:00
|
|
|
|
local insert = helpers.insert
|
2017-04-08 14:12:26 -07:00
|
|
|
|
local expect = helpers.expect
|
|
|
|
|
local command = helpers.command
|
2016-01-30 13:36:33 -07:00
|
|
|
|
|
|
|
|
|
describe('search_mbyte', function()
|
2016-02-01 00:52:24 -07:00
|
|
|
|
before_each(clear)
|
2016-01-30 13:36:33 -07:00
|
|
|
|
|
2016-02-14 23:46:04 -07:00
|
|
|
|
it("search('multi-byte char', 'bce')", function()
|
2016-01-30 13:36:33 -07:00
|
|
|
|
insert([=[
|
|
|
|
|
Results:
|
2017-04-08 14:12:26 -07:00
|
|
|
|
|
2016-01-30 13:36:33 -07:00
|
|
|
|
Test bce:
|
|
|
|
|
A]=])
|
2020-10-19 11:17:51 -07:00
|
|
|
|
poke_eventloop()
|
2016-01-30 13:36:33 -07:00
|
|
|
|
|
2017-04-08 14:12:26 -07:00
|
|
|
|
command('/^Test bce:/+1')
|
|
|
|
|
command([[$put =search('A', 'bce', line('.'))]])
|
2016-01-30 13:36:33 -07:00
|
|
|
|
|
|
|
|
|
-- Assert buffer contents.
|
|
|
|
|
expect([=[
|
|
|
|
|
Results:
|
2017-04-08 14:12:26 -07:00
|
|
|
|
|
2016-01-30 13:36:33 -07:00
|
|
|
|
Test bce:
|
|
|
|
|
A
|
|
|
|
|
4]=])
|
|
|
|
|
end)
|
|
|
|
|
end)
|