mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
functests: Replace execute with either command or feed_command
Hope this will make people using feed_command less likely: this hides bugs. Already found at least two: 1. msgpackparse() will show internal error: hash_add() in case of duplicate keys, though it will still work correctly. Currently silenced. 2. ttimeoutlen was spelled incorrectly, resulting in option not being set when expected. Test was still functioning somehow though. Currently fixed.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local clear, feed, execute = helpers.clear, helpers.feed, helpers.execute
|
||||
local clear, feed, feed_command = helpers.clear, helpers.feed, helpers.feed_command
|
||||
|
||||
describe(":drop", function()
|
||||
local screen
|
||||
@@ -15,7 +15,7 @@ describe(":drop", function()
|
||||
[2] = {reverse = true},
|
||||
[3] = {bold = true},
|
||||
})
|
||||
execute("set laststatus=2")
|
||||
feed_command("set laststatus=2")
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
@@ -23,7 +23,7 @@ describe(":drop", function()
|
||||
end)
|
||||
|
||||
it("works like :e when called with only one window open", function()
|
||||
execute("drop tmp1.vim")
|
||||
feed_command("drop tmp1.vim")
|
||||
screen:expect([[
|
||||
^ |
|
||||
{0:~ }|
|
||||
@@ -39,10 +39,10 @@ describe(":drop", function()
|
||||
end)
|
||||
|
||||
it("switches to an open window showing the buffer", function()
|
||||
execute("edit tmp1")
|
||||
execute("vsplit")
|
||||
execute("edit tmp2")
|
||||
execute("drop tmp1")
|
||||
feed_command("edit tmp1")
|
||||
feed_command("vsplit")
|
||||
feed_command("edit tmp2")
|
||||
feed_command("drop tmp1")
|
||||
screen:expect([[
|
||||
{2:|}^ |
|
||||
{0:~ }{2:|}{0:~ }|
|
||||
@@ -58,11 +58,11 @@ describe(":drop", function()
|
||||
end)
|
||||
|
||||
it("splits off a new window when a buffer can't be abandoned", function()
|
||||
execute("edit tmp1")
|
||||
execute("vsplit")
|
||||
execute("edit tmp2")
|
||||
feed_command("edit tmp1")
|
||||
feed_command("vsplit")
|
||||
feed_command("edit tmp2")
|
||||
feed("iABC<esc>")
|
||||
execute("drop tmp3")
|
||||
feed_command("drop tmp3")
|
||||
screen:expect([[
|
||||
^ {2:|} |
|
||||
{0:~ }{2:|}{0:~ }|
|
||||
|
||||
Reference in New Issue
Block a user