diff options
Diffstat (limited to 'test/functional/legacy')
-rw-r--r-- | test/functional/legacy/051_highlight_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/legacy/063_match_and_matchadd_spec.lua | 5 | ||||
-rw-r--r-- | test/functional/legacy/arglist_spec.lua | 29 |
3 files changed, 32 insertions, 4 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/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) |