diff --git a/src/nvim/testdir/test7.in b/src/nvim/testdir/test7.in deleted file mode 100644 index b9cc0585f6a380..00000000000000 --- a/src/nvim/testdir/test7.in +++ /dev/null @@ -1,26 +0,0 @@ -Test for autocommand that changes the buffer list, when doing ":ball". - -STARTTEST -:so small.vim -/^start of -A1:.,/end of/w! Xxx1 " write test file Xxx1 -:sp Xxx1 -:close -$r2:.,/end of/w! Xxx2 " write test file Xxx2 -:sp Xxx2 -:close -$r3:.,/end of/w! Xxx3 " write test file Xxx3 -:sp Xxx3 -:close -:au BufReadPost Xxx2 bwipe -$r4:ball " open window for all args, close Xxx2 -:.,$w! test.out " Write contents of this file -:w >>test.out " Append contents of second window (Xxx1) -:/^start of/,$w >>test.out " Append contents of last window (this file) -:qa! -ENDTEST - -start of test file Xxx - this is a test - this is a test -end of test file Xxx diff --git a/src/nvim/testdir/test7.ok b/src/nvim/testdir/test7.ok deleted file mode 100644 index a0d1ff94a3449a..00000000000000 --- a/src/nvim/testdir/test7.ok +++ /dev/null @@ -1,12 +0,0 @@ -start of test file Xxx4 - this is a test - this is a test -end of test file Xxx -start of test file Xxx1 - this is a test - this is a test -end of test file Xxx -start of test file Xxx4 - this is a test - this is a test -end of test file Xxx diff --git a/test/functional/legacy/007_ball_buffer_list_spec.lua b/test/functional/legacy/007_ball_buffer_list_spec.lua new file mode 100644 index 00000000000000..6d8932321585ab --- /dev/null +++ b/test/functional/legacy/007_ball_buffer_list_spec.lua @@ -0,0 +1,77 @@ +-- Test for autocommand that changes the buffer list, when doing ":ball". + +local helpers = require('test.functional.helpers') +local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert +local execute, expect = helpers.execute, helpers.expect + +describe(':ball', function() + setup(clear) + + it('is working', function() + insert([[ + start of test file Xxx + this is a test + this is a test + end of test file Xxx]]) + + execute('w! Xxx0') + feed('gg') + + -- Write test file Xxx1 + feed('A1:.,/end of/w! Xxx1') + execute('sp Xxx1') + execute('close') + + -- Write test file Xxx2 + feed('$r2:.,/end of/w! Xxx2') + execute('sp Xxx2') + execute('close') + + -- Write test file Xxx3 + feed('$r3:.,/end of/w! Xxx3') + execute('sp Xxx3') + execute('close') + + execute('au BufReadPost Xxx2 bwipe') + + -- Open window for all args, close Xxx2 + feed('$r4:ball') + + -- Write contents of this file + execute('%yank A') + + -- Append contents of second window (Xxx1) + feed('') + execute('%yank A') + + -- Append contents of last window (this file) + feed('') + execute('%yank A') + + execute('bf') + execute('%d') + execute('0put=@a') + execute('1d | $d') + + expect([[ + start of test file Xxx4 + this is a test + this is a test + end of test file Xxx + start of test file Xxx1 + this is a test + this is a test + end of test file Xxx + start of test file Xxx4 + this is a test + this is a test + end of test file Xxx]]) + end) + + teardown(function() + os.remove('Xxx0') + os.remove('Xxx1') + os.remove('Xxx2') + os.remove('Xxx3') + end) +end)