aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/061_undo_tree_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
commit1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch)
treecd08258054db80bb9a11b1061bb091c70b76926a /test/functional/legacy/061_undo_tree_spec.lua
parenteaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-aucmd_textputpost.tar.gz
rneovim-aucmd_textputpost.tar.bz2
rneovim-aucmd_textputpost.zip
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'test/functional/legacy/061_undo_tree_spec.lua')
-rw-r--r--test/functional/legacy/061_undo_tree_spec.lua17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/functional/legacy/061_undo_tree_spec.lua b/test/functional/legacy/061_undo_tree_spec.lua
index 1a8ef067d0..b5af8f7d52 100644
--- a/test/functional/legacy/061_undo_tree_spec.lua
+++ b/test/functional/legacy/061_undo_tree_spec.lua
@@ -22,29 +22,30 @@ end
describe('undo tree:', function()
before_each(clear)
+ local fname = 'Xtest_functional_legacy_undotree'
teardown(function()
- os.remove('Xtest.source')
+ os.remove(fname .. '.source')
end)
describe(':earlier and :later', function()
before_each(function()
- os.remove('Xtest')
+ os.remove(fname)
end)
teardown(function()
- os.remove('Xtest')
+ os.remove(fname)
end)
it('time specifications, g- g+', function()
-- We write the test text to a file in order to prevent nvim to record
-- the inserting of the text into the undo history.
- write_file('Xtest', '\n123456789\n')
+ write_file(fname, '\n123456789\n')
-- `:earlier` and `:later` are (obviously) time-sensitive, so this test
-- sometimes fails if the system is under load. It is wrapped in a local
-- function to allow multiple attempts.
local function test_earlier_later()
clear()
- feed_command('e Xtest')
+ feed_command('e ' .. fname)
-- Assert that no undo history is present.
eq({}, eval('undotree().entries'))
-- Delete three characters and undo.
@@ -103,7 +104,7 @@ describe('undo tree:', function()
it('file-write specifications', function()
feed('ione one one<esc>')
- feed_command('w Xtest')
+ feed_command('w ' .. fname)
feed('otwo<esc>')
feed('otwo<esc>')
feed_command('w')
@@ -187,7 +188,7 @@ describe('undo tree:', function()
it('undo an expression-register', function()
local normal_commands = 'o1\027a2\018=string(123)\n\027'
- write_file('Xtest.source', normal_commands)
+ write_file(fname .. '.source', normal_commands)
feed('oa<esc>')
feed('ob<esc>')
@@ -221,7 +222,7 @@ describe('undo tree:', function()
c
12]])
feed('od<esc>')
- feed_command('so! Xtest.source')
+ feed_command('so! ' .. fname .. '.source')
expect([[
a