aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/drop_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ex_cmds/drop_spec.lua')
-rw-r--r--test/functional/ex_cmds/drop_spec.lua71
1 files changed, 36 insertions, 35 deletions
diff --git a/test/functional/ex_cmds/drop_spec.lua b/test/functional/ex_cmds/drop_spec.lua
index 16b194dd7d..d6da0d8e88 100644
--- a/test/functional/ex_cmds/drop_spec.lua
+++ b/test/functional/ex_cmds/drop_spec.lua
@@ -1,6 +1,7 @@
local helpers = require('test.functional.helpers')(after_each)
+local command = helpers.command
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
@@ -9,13 +10,13 @@ describe(":drop", function()
clear()
screen = Screen.new(35, 10)
screen:attach()
- screen:set_default_attr_ignore({{bold=true, foreground=Screen.colors.Blue}})
screen:set_default_attr_ids({
+ [0] = {bold=true, foreground=Screen.colors.Blue},
[1] = {bold = true, reverse = true},
[2] = {reverse = true},
[3] = {bold = true},
})
- execute("set laststatus=2")
+ command("set laststatus=2 shortmess-=F")
end)
after_each(function()
@@ -23,55 +24,55 @@ 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:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
{1:tmp1.vim }|
"tmp1.vim" [New File] |
]])
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:|}^ |
- ~ {2:|}~ |
- ~ {2:|}~ |
- ~ {2:|}~ |
- ~ {2:|}~ |
- ~ {2:|}~ |
- ~ {2:|}~ |
- ~ {2:|}~ |
+ {2:│}^ |
+ {0:~ }{2:│}{0:~ }|
+ {0:~ }{2:│}{0:~ }|
+ {0:~ }{2:│}{0:~ }|
+ {0:~ }{2:│}{0:~ }|
+ {0:~ }{2:│}{0:~ }|
+ {0:~ }{2:│}{0:~ }|
+ {0:~ }{2:│}{0:~ }|
{2:tmp2 }{1:tmp1 }|
:drop tmp1 |
]])
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:|} |
- ~ {2:|}~ |
- ~ {2:|}~ |
- ~ {2:|}~ |
- {1:tmp3 }{2:|}~ |
- ABC {2:|}~ |
- ~ {2:|}~ |
- ~ {2:|}~ |
+ ^ {2:│} |
+ {0:~ }{2:│}{0:~ }|
+ {0:~ }{2:│}{0:~ }|
+ {0:~ }{2:│}{0:~ }|
+ {1:tmp3 }{2:│}{0:~ }|
+ ABC {2:│}{0:~ }|
+ {0:~ }{2:│}{0:~ }|
+ {0:~ }{2:│}{0:~ }|
{2:tmp2 [+] tmp1 }|
"tmp3" [New File] |
]])