aboutsummaryrefslogtreecommitdiff
path: root/test/functional/editor
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-27 15:51:44 +0800
committerGitHub <noreply@github.com>2023-04-27 15:51:44 +0800
commitd321deb4a9b05e9d81b79ac166274f4a6e7981bf (patch)
tree195446b3e2668a53edb44e93223905b9939073d6 /test/functional/editor
parentd1bb9bffd5e86d30696969e001af3c3db8ed4bcf (diff)
downloadrneovim-d321deb4a9b05e9d81b79ac166274f4a6e7981bf.tar.gz
rneovim-d321deb4a9b05e9d81b79ac166274f4a6e7981bf.tar.bz2
rneovim-d321deb4a9b05e9d81b79ac166274f4a6e7981bf.zip
test: fix dependencies between test cases (#23343)
Discovered using --shuffle argument of busted.
Diffstat (limited to 'test/functional/editor')
-rw-r--r--test/functional/editor/fold_spec.lua22
-rw-r--r--test/functional/editor/put_spec.lua2
2 files changed, 13 insertions, 11 deletions
diff --git a/test/functional/editor/fold_spec.lua b/test/functional/editor/fold_spec.lua
index 3115c20410..0ed9d1ba80 100644
--- a/test/functional/editor/fold_spec.lua
+++ b/test/functional/editor/fold_spec.lua
@@ -58,11 +58,11 @@ describe('Folds', function()
describe('adjusting folds after :move', function()
local function manually_fold_indent()
-- setting foldmethod twice is a trick to get vim to set the folds for me
- command('set foldmethod=indent')
- command('set foldmethod=manual')
+ command('setlocal foldmethod=indent')
+ command('setlocal foldmethod=manual')
-- Ensure that all folds will get closed (makes it easier to test the
-- length of folds).
- command('set foldminlines=0')
+ command('setlocal foldminlines=0')
-- Start with all folds open (so :move ranges aren't affected by closed
-- folds).
command('%foldopen!')
@@ -83,7 +83,7 @@ describe('Folds', function()
command(move_command)
local after_move_folds = get_folds()
-- Doesn't change anything, but does call foldUpdateAll()
- command('set foldminlines=0')
+ command('setlocal foldminlines=0')
eq(after_move_folds, get_folds())
-- Set up the buffer with insert_string for the manual fold testing.
command('enew!')
@@ -279,7 +279,7 @@ a]], '13m7')
a
a
]])
- command('set foldmethod=indent')
+ command('setlocal foldmethod=indent')
command('2')
command('%foldopen')
command('read ' .. tempfname)
@@ -317,7 +317,7 @@ a]], '13m7')
a
a
]])
- command('set foldmethod=indent')
+ command('setlocal foldmethod=indent')
command('3,5d')
eq(5, funcs.foldclosedend(1))
end)
@@ -333,7 +333,7 @@ a]], '13m7')
}}}
]])
- command('set foldmethod=marker')
+ command('setlocal foldmethod=marker')
command('3,5d')
command('%foldclose')
eq(2, funcs.foldclosedend(1))
@@ -372,7 +372,7 @@ a]], '13m7')
a
a
]])
- command('set foldmethod=expr foldexpr=TestFoldExpr(v:lnum)')
+ command('setlocal foldmethod=expr foldexpr=TestFoldExpr(v:lnum)')
command('2')
command('foldopen')
command('read ' .. tempfname)
@@ -386,7 +386,7 @@ a]], '13m7')
end)
it('no folds remain if :delete makes buffer empty #19671', function()
- command('set foldmethod=manual')
+ command('setlocal foldmethod=manual')
funcs.setline(1, {'foo', 'bar', 'baz'})
command('2,3fold')
command('%delete')
@@ -394,7 +394,7 @@ a]], '13m7')
end)
it('multibyte fold markers work #20438', function()
- command('set foldmethod=marker foldmarker=«,» commentstring=/*%s*/')
+ command('setlocal foldmethod=marker foldmarker=«,» commentstring=/*%s*/')
insert([[
bbbbb
bbbbb
@@ -412,7 +412,7 @@ a]], '13m7')
a
b
]])
- command('set foldmethod=indent shiftwidth=2')
+ command('setlocal foldmethod=indent shiftwidth=2')
feed('gg0<C-v>jI <Esc>') -- indent both lines using visual blockwise mode
eq(1, funcs.foldlevel(1))
eq(1, funcs.foldlevel(2))
diff --git a/test/functional/editor/put_spec.lua b/test/functional/editor/put_spec.lua
index fb55b71e43..47068470bb 100644
--- a/test/functional/editor/put_spec.lua
+++ b/test/functional/editor/put_spec.lua
@@ -902,6 +902,8 @@ describe('put command', function()
end
end
end, unchanged=(not should_ring)}
+ screen.bell = false
+ screen.visualbell = false
end
it('should not ring the bell with gp at end of line', function()