aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-04-05 22:39:40 -0400
committerJames McCoy <jamessan@jamessan.com>2017-04-05 22:39:40 -0400
commitbb54d921aaf85f0393c1ba10585560056f7f4ec8 (patch)
tree316ff7424337b3572b58340383eeabb3a0d36e80 /test/functional/legacy
parent4f69a8fb8854698adb2de8956ad0d86ff35a6f68 (diff)
parent210b013ce75b5ea8a897071e32decc1e1f88189e (diff)
downloadrneovim-bb54d921aaf85f0393c1ba10585560056f7f4ec8.tar.gz
rneovim-bb54d921aaf85f0393c1ba10585560056f7f4ec8.tar.bz2
rneovim-bb54d921aaf85f0393c1ba10585560056f7f4ec8.zip
Merge remote-tracking branch 'origin/master' into vim-7.4.2170
Diffstat (limited to 'test/functional/legacy')
-rw-r--r--test/functional/legacy/051_highlight_spec.lua2
-rw-r--r--test/functional/legacy/062_tab_pages_spec.lua16
-rw-r--r--test/functional/legacy/063_match_and_matchadd_spec.lua5
-rw-r--r--test/functional/legacy/arglist_spec.lua29
4 files changed, 34 insertions, 18 deletions
diff --git a/test/functional/legacy/051_highlight_spec.lua b/test/functional/legacy/051_highlight_spec.lua
index ef392d8c67..d4d9b7d997 100644
--- a/test/functional/legacy/051_highlight_spec.lua
+++ b/test/functional/legacy/051_highlight_spec.lua
@@ -16,7 +16,7 @@ describe(':highlight', function()
local screen = Screen.new(35, 10)
screen:attach()
-- Basic test if ":highlight" doesn't crash
- execute('highlight')
+ execute('set more', 'highlight')
-- FIXME(tarruda): We need to be sure the prompt is displayed before
-- continuing, or risk a race condition where some of the following input
-- is discarded resulting in test failure
diff --git a/test/functional/legacy/062_tab_pages_spec.lua b/test/functional/legacy/062_tab_pages_spec.lua
index d5b10b160e..71a0a77354 100644
--- a/test/functional/legacy/062_tab_pages_spec.lua
+++ b/test/functional/legacy/062_tab_pages_spec.lua
@@ -99,10 +99,6 @@ describe('tab pages', function()
eq(7, eval('tabpagenr()'))
execute('tabmove')
eq(10, eval('tabpagenr()'))
- execute('tabmove -20')
- eq(1, eval('tabpagenr()'))
- execute('tabmove +20')
- eq(10, eval('tabpagenr()'))
execute('0tabmove')
eq(1, eval('tabpagenr()'))
execute('$tabmove')
@@ -172,7 +168,7 @@ describe('tab pages', function()
C tabnext 1
autocmd TabDestructive TabEnter * nested
\ :C tabnext 2 | C tabclose 3
- C tabnext 3
+ C tabnext 2
let g:r+=[tabpagenr().'/'.tabpagenr('$')]
endfunction
call Test()
@@ -233,22 +229,14 @@ describe('tab pages', function()
WinEnter
TabEnter
BufEnter
- === tabnext 3 ===
- BufLeave
- WinLeave
- TabLeave
- WinEnter
- TabEnter
=== tabnext 2 ===
- BufLeave
WinLeave
TabLeave
WinEnter
TabEnter
=== tabnext 2 ===
=== tabclose 3 ===
- BufEnter
- === tabclose 3 ===
2/2]])
+ eq(2, eval("tabpagenr('$')"))
end)
end)
diff --git a/test/functional/legacy/063_match_and_matchadd_spec.lua b/test/functional/legacy/063_match_and_matchadd_spec.lua
index 298e0a31ea..5818bb6b3a 100644
--- a/test/functional/legacy/063_match_and_matchadd_spec.lua
+++ b/test/functional/legacy/063_match_and_matchadd_spec.lua
@@ -97,11 +97,10 @@ describe('063: Test for ":match", "matchadd()" and related functions', function(
-- Check that "setmatches()" will not add two matches with the same ID. The
-- expected behaviour (for now) is to add the first match but not the
- -- second and to return 0 (even though it is a matter of debate whether
- -- this can be considered successful behaviour).
+ -- second and to return -1.
execute("let r1 = setmatches([{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}, {'group': 'MyGroup2', 'pattern': 'FIXME', 'priority': 10, 'id': 1}])")
feed("<cr>")
- eq(0, eval("r1"))
+ eq(-1, eval("r1"))
eq({{group = 'MyGroup1', pattern = 'TODO', priority = 10, id = 1}}, eval('getmatches()'))
-- Check that "setmatches()" returns 0 if successful and otherwise -1.
diff --git a/test/functional/legacy/arglist_spec.lua b/test/functional/legacy/arglist_spec.lua
index f5e3522972..b9075620dc 100644
--- a/test/functional/legacy/arglist_spec.lua
+++ b/test/functional/legacy/arglist_spec.lua
@@ -269,4 +269,33 @@ describe('argument list commands', function()
eq(0, eval('argidx()'))
execute('%argd')
end)
+
+
+ it('test for autocommand that redefines the argument list, when doing ":all"', function()
+ execute('autocmd BufReadPost Xxx2 next Xxx2 Xxx1')
+ execute("call writefile(['test file Xxx1'], 'Xxx1')")
+ execute("call writefile(['test file Xxx2'], 'Xxx2')")
+ execute("call writefile(['test file Xxx3'], 'Xxx3')")
+
+ execute('new')
+ -- redefine arglist; go to Xxx1
+ execute('next! Xxx1 Xxx2 Xxx3')
+ -- open window for all args
+ execute('all')
+ eq('test file Xxx1', eval('getline(1)'))
+ execute('wincmd w')
+ execute('wincmd w')
+ eq('test file Xxx1', eval('getline(1)'))
+ -- should now be in Xxx2
+ execute('rewind')
+ eq('test file Xxx2', eval('getline(1)'))
+
+ execute('autocmd! BufReadPost Xxx2')
+ execute('enew! | only')
+ execute("call delete('Xxx1')")
+ execute("call delete('Xxx2')")
+ execute("call delete('Xxx3')")
+ execute('argdelete Xxx*')
+ execute('bwipe! Xxx1 Xxx2 Xxx3')
+ end)
end)