diff options
author | ZyX <kp-pav@yandex.ru> | 2016-02-28 04:49:26 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2016-02-28 04:54:23 +0300 |
commit | b32396170f2c1cd17f36b8a5eb1ad313f6f9a8c3 (patch) | |
tree | ea9719abe975116c3473e45a282906a76a2acf00 /test/functional/terminal/edit_spec.lua | |
parent | a1493215a2e18f3b0a18a7d77222e0bf93ca32b3 (diff) | |
download | rneovim-b32396170f2c1cd17f36b8a5eb1ad313f6f9a8c3.tar.gz rneovim-b32396170f2c1cd17f36b8a5eb1ad313f6f9a8c3.tar.bz2 rneovim-b32396170f2c1cd17f36b8a5eb1ad313f6f9a8c3.zip |
main: Make using :edit term:// run TermOpen event
Ref #4306
Diffstat (limited to 'test/functional/terminal/edit_spec.lua')
-rw-r--r-- | test/functional/terminal/edit_spec.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/terminal/edit_spec.lua b/test/functional/terminal/edit_spec.lua new file mode 100644 index 0000000000..924f90e8f8 --- /dev/null +++ b/test/functional/terminal/edit_spec.lua @@ -0,0 +1,23 @@ +local helpers = require('test.functional.helpers') + +local nvim_dir = helpers.nvim_dir +local command = helpers.command +local meths = helpers.meths +local clear = helpers.clear +local eq = helpers.eq + +describe(':edit term://*', function() + before_each(function() + clear() + meths.set_option('shell', nvim_dir .. '/shell-test') + end) + + it('runs TermOpen event', function() + meths.set_var('termopen_runs', {}) + command('autocmd TermOpen * :call add(g:termopen_runs, expand("<amatch>"))') + command('edit term://') + termopen_runs = meths.get_var('termopen_runs') + eq(1, #termopen_runs) + eq(termopen_runs[1], termopen_runs[1]:match('^term://.//%d+:$')) + end) +end) |