aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-05-15 20:33:12 -0400
committerJustin M. Keyes <justinkz@gmail.com>2016-05-15 20:33:12 -0400
commit082abb7ca6f45fa937a0377a5edc68929a1c08a9 (patch)
treecd242503ae8909249a03cb7871943d34ea8c7568 /test/functional
parent3cc2a28198822a9e9de4d317d92d6a3fbd42e04a (diff)
parentf583bc94fc7e08cca6ca85ea5a3cd38368e54df7 (diff)
downloadrneovim-082abb7ca6f45fa937a0377a5edc68929a1c08a9.tar.gz
rneovim-082abb7ca6f45fa937a0377a5edc68929a1c08a9.tar.bz2
rneovim-082abb7ca6f45fa937a0377a5edc68929a1c08a9.zip
Merge pull request #4760 from justinmk/term-use-after-free
term_close use-after-free
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/legacy/068_text_formatting_spec.lua4
-rw-r--r--test/functional/terminal/buffer_spec.lua13
-rw-r--r--test/functional/terminal/ex_terminal_spec.lua6
3 files changed, 15 insertions, 8 deletions
diff --git a/test/functional/legacy/068_text_formatting_spec.lua b/test/functional/legacy/068_text_formatting_spec.lua
index 0e3d66e0e5..cac8be77f3 100644
--- a/test/functional/legacy/068_text_formatting_spec.lua
+++ b/test/functional/legacy/068_text_formatting_spec.lua
@@ -1,7 +1,5 @@
--- Test for text formatting.
-
local helpers = require('test.functional.helpers')
-local feed, insert, source = helpers.feed, helpers.insert, helpers.source
+local feed, insert = helpers.feed, helpers.insert
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
describe('text formatting', function()
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua
index 55ef254a63..cefb603a7e 100644
--- a/test/functional/terminal/buffer_spec.lua
+++ b/test/functional/terminal/buffer_spec.lua
@@ -158,8 +158,7 @@ describe('terminal buffer', function()
end)
it('handles loss of focus gracefully', function()
- -- Temporarily change the statusline to avoid printing the file name, which
- -- varies be where the test is run.
+ -- Change the statusline to avoid printing the file name, which varies.
nvim('set_option', 'statusline', '==========')
execute('set laststatus=0')
@@ -195,5 +194,15 @@ describe('terminal buffer', function()
execute('set laststatus=1') -- Restore laststatus to the default.
end)
+
+ it('term_close() use-after-free #4393', function()
+ if eval("executable('yes')") == 0 then
+ pending('missing "yes" command')
+ return
+ end
+ execute('terminal yes')
+ feed([[<C-\><C-n>]])
+ execute('bdelete!')
+ end)
end)
diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua
index a3937ca4ba..d89092ff27 100644
--- a/test/functional/terminal/ex_terminal_spec.lua
+++ b/test/functional/terminal/ex_terminal_spec.lua
@@ -1,7 +1,7 @@
local helpers = require('test.functional.helpers')
local Screen = require('test.functional.ui.screen')
local clear, wait, nvim = helpers.clear, helpers.wait, helpers.nvim
-local nvim_dir, source, ok = helpers.nvim_dir, helpers.source, helpers.ok
+local nvim_dir, source, eq = helpers.nvim_dir, helpers.source, helpers.eq
local execute, eval = helpers.execute, helpers.eval
describe(':terminal', function()
@@ -53,7 +53,7 @@ describe(':terminal', function()
source([[
autocmd BufNew * set shell=foo
terminal]])
- -- Verify that BufNew actually fired (else the test is useless).
- ok('foo' == eval('&shell'))
+ -- Verify that BufNew actually fired (else the test is invalid).
+ eq('foo', eval('&shell'))
end)
end)