mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
test/put_spec: 2x speedup (#6294)
Instead of helpers.clear() between each test, use execute('enew!')
and ensure the state that matters is reset between each test.
This commit is contained in:
committed by
Justin M. Keyes
parent
b6502b868e
commit
9abef7ded9
@@ -15,7 +15,7 @@ local dedent = helpers.dedent
|
|||||||
local getreg = funcs.getreg
|
local getreg = funcs.getreg
|
||||||
|
|
||||||
local function reset()
|
local function reset()
|
||||||
clear()
|
execute('enew!')
|
||||||
insert([[
|
insert([[
|
||||||
Line of words 1
|
Line of words 1
|
||||||
Line of words 2]])
|
Line of words 2]])
|
||||||
@@ -24,6 +24,7 @@ local function reset()
|
|||||||
funcs.setreg('a', 'test_stringa', 'V')
|
funcs.setreg('a', 'test_stringa', 'V')
|
||||||
funcs.setreg('b', 'test_stringb\ntest_stringb\ntest_stringb', 'b')
|
funcs.setreg('b', 'test_stringb\ntest_stringb\ntest_stringb', 'b')
|
||||||
funcs.setreg('"', 'test_string"', 'v')
|
funcs.setreg('"', 'test_string"', 'v')
|
||||||
|
execute('set virtualedit=')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- We check the last inserted register ". in each of these tests because it is
|
-- We check the last inserted register ". in each of these tests because it is
|
||||||
@@ -31,9 +32,6 @@ end
|
|||||||
-- It is implemented differently so that control characters and imap'ped
|
-- It is implemented differently so that control characters and imap'ped
|
||||||
-- characters work in the same manner when pasted as when inserted.
|
-- characters work in the same manner when pasted as when inserted.
|
||||||
describe('put command', function()
|
describe('put command', function()
|
||||||
-- Put a call to clear() here to force the connection to the server.
|
|
||||||
-- This means we can use the funcs.*() functions while mangling text before
|
|
||||||
-- the actual tests are run.
|
|
||||||
clear()
|
clear()
|
||||||
before_each(reset)
|
before_each(reset)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user