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.lua27
1 files changed, 22 insertions, 5 deletions
diff --git a/test/functional/ex_cmds/drop_spec.lua b/test/functional/ex_cmds/drop_spec.lua
index cbda5aac98..54ddd79a35 100644
--- a/test/functional/ex_cmds/drop_spec.lua
+++ b/test/functional/ex_cmds/drop_spec.lua
@@ -1,7 +1,9 @@
-local helpers = require('test.functional.helpers')(after_each)
-local command = helpers.command
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, feed, feed_command = helpers.clear, helpers.feed, helpers.feed_command
+
+local command = n.command
+local clear, feed, feed_command = n.clear, n.feed, n.feed_command
+local exec = n.exec
describe(':drop', function()
local screen
@@ -16,7 +18,7 @@ describe(':drop', function()
[2] = { reverse = true },
[3] = { bold = true },
})
- command('set laststatus=2 shortmess-=F')
+ command('set nohidden laststatus=2 shortmess-=F')
end)
it('works like :e when called with only one window open', function()
@@ -43,7 +45,6 @@ describe(':drop', function()
end)
it("splits off a new window when a buffer can't be abandoned", function()
- command('set nohidden')
feed_command('edit tmp1')
feed_command('vsplit')
feed_command('edit tmp2')
@@ -59,4 +60,20 @@ describe(':drop', function()
"tmp3" [New] |
]])
end)
+
+ -- oldtest: Test_drop_modified_file()
+ it('does not cause E37 with modified same file', function()
+ exec([[
+ edit Xdrop_modified.txt
+ call setline(1, 'The quick brown fox jumped over the lazy dogs')
+ ]])
+ feed_command('drop Xdrop_modified.txt')
+ screen:expect([[
+ ^The quick brown fox jumped over the|
+ lazy dogs |
+ {0:~ }|*6
+ {1:Xdrop_modified.txt [+] }|
+ :drop Xdrop_modified.txt |
+ ]])
+ end)
end)