aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Malcomson <hardenedapple@gmail.com>2017-03-18 00:59:51 +0000
committerJustin M. Keyes <justinkz@gmail.com>2017-03-18 01:59:51 +0100
commit9abef7ded95995e3546b8d273ab4ad996ce3ed50 (patch)
treecdb0473f2ff10b697eed7d3c7a1906e04f134ea4
parentb6502b868e0150b3527cae1f1bda67a95bdf46be (diff)
downloadrneovim-9abef7ded95995e3546b8d273ab4ad996ce3ed50.tar.gz
rneovim-9abef7ded95995e3546b8d273ab4ad996ce3ed50.tar.bz2
rneovim-9abef7ded95995e3546b8d273ab4ad996ce3ed50.zip
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.
-rw-r--r--test/functional/normal/put_spec.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/functional/normal/put_spec.lua b/test/functional/normal/put_spec.lua
index 36d5e8b43c..b3162364a6 100644
--- a/test/functional/normal/put_spec.lua
+++ b/test/functional/normal/put_spec.lua
@@ -15,7 +15,7 @@ local dedent = helpers.dedent
local getreg = funcs.getreg
local function reset()
- clear()
+ execute('enew!')
insert([[
Line of words 1
Line of words 2]])
@@ -24,6 +24,7 @@ local function reset()
funcs.setreg('a', 'test_stringa', 'V')
funcs.setreg('b', 'test_stringb\ntest_stringb\ntest_stringb', 'b')
funcs.setreg('"', 'test_string"', 'v')
+ execute('set virtualedit=')
end
-- 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
-- characters work in the same manner when pasted as when inserted.
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()
before_each(reset)