From 9abef7ded95995e3546b8d273ab4ad996ce3ed50 Mon Sep 17 00:00:00 2001 From: Matthew Malcomson Date: Sat, 18 Mar 2017 00:59:51 +0000 Subject: [PATCH] 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. --- test/functional/normal/put_spec.lua | 6 ++---- 1 file 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)