aboutsummaryrefslogtreecommitdiff
path: root/test/functional/shada/history_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/shada/history_spec.lua')
-rw-r--r--test/functional/shada/history_spec.lua27
1 files changed, 20 insertions, 7 deletions
diff --git a/test/functional/shada/history_spec.lua b/test/functional/shada/history_spec.lua
index c8a19bb082..39a5f8df7e 100644
--- a/test/functional/shada/history_spec.lua
+++ b/test/functional/shada/history_spec.lua
@@ -1,12 +1,13 @@
-- ShaDa history saving/reading support
-local helpers = require('test.functional.helpers')(after_each)
-local nvim_command, fn, api, nvim_feed, eq =
- helpers.command, helpers.fn, helpers.api, helpers.feed, helpers.eq
-local assert_alive = helpers.assert_alive
-local expect_exit = helpers.expect_exit
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
+local t_shada = require('test.functional.shada.testutil')
-local shada_helpers = require('test.functional.shada.helpers')
-local reset, clear = shada_helpers.reset, shada_helpers.clear
+local nvim_command, fn, api, nvim_feed, eq = n.command, n.fn, n.api, n.feed, t.eq
+local assert_alive = n.assert_alive
+local expect_exit = n.expect_exit
+
+local reset, clear = t_shada.reset, t_shada.clear
describe('ShaDa support code', function()
before_each(reset)
@@ -115,6 +116,12 @@ describe('ShaDa support code', function()
nvim_feed('gg0n')
eq({ 0, 2, 3, 0 }, fn.getpos('.'))
eq(1, api.nvim_get_vvar('searchforward'))
+ -- Autocommands shouldn't cause search pattern to change
+ nvim_command('autocmd User * :')
+ nvim_command('doautocmd User')
+ nvim_feed('gg0n')
+ eq({ 0, 2, 3, 0 }, fn.getpos('.'))
+ eq(1, api.nvim_get_vvar('searchforward'))
end)
it('dumps and loads last search pattern with offset and backward direction', function()
@@ -129,6 +136,12 @@ describe('ShaDa support code', function()
nvim_feed('G$n')
eq({ 0, 2, 3, 0 }, fn.getpos('.'))
eq(0, api.nvim_get_vvar('searchforward'))
+ -- Autocommands shouldn't cause search pattern to change
+ nvim_command('autocmd User * :')
+ nvim_command('doautocmd User')
+ nvim_feed('G$n')
+ eq({ 0, 2, 3, 0 }, fn.getpos('.'))
+ eq(0, api.nvim_get_vvar('searchforward'))
end)
it('saves v:hlsearch=1', function()