aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Borene <rainerborene@gmail.com>2014-10-27 21:52:29 -0200
committerThiago de Arruda <tpadilha84@gmail.com>2014-11-04 12:57:33 -0300
commitef08a2c0df7f6bda1d507f41a46d1ab3069d1b8f (patch)
tree532f6b30367e8144266b7c2e68de8d7147878554
parent38bef424a2cdece286d7f87dfbe76a55d76c16f7 (diff)
downloadrneovim-ef08a2c0df7f6bda1d507f41a46d1ab3069d1b8f.tar.gz
rneovim-ef08a2c0df7f6bda1d507f41a46d1ab3069d1b8f.tar.bz2
rneovim-ef08a2c0df7f6bda1d507f41a46d1ab3069d1b8f.zip
legacy tests: migrate test6
-rw-r--r--src/nvim/testdir/test6.in24
-rw-r--r--src/nvim/testdir/test6.ok18
-rw-r--r--test/functional/legacy/006_argument_list_spec.lua81
3 files changed, 81 insertions, 42 deletions
diff --git a/src/nvim/testdir/test6.in b/src/nvim/testdir/test6.in
deleted file mode 100644
index 1ebbe2fa51..0000000000
--- a/src/nvim/testdir/test6.in
+++ /dev/null
@@ -1,24 +0,0 @@
-Test for autocommand that redefines the argument list, when doing ":all".
-
-STARTTEST
-:so small.vim
-:au BufReadPost Xxx2 next Xxx2 Xxx1
-/^start of
-A1:.,/end of/w! Xxx1 " write test file Xxx1
-$r2:.,/end of/w! Xxx2 " write test file Xxx2
-$r3:.,/end of/w! Xxx3 " write test file Xxx3
-:next! Xxx1 Xxx2 Xxx3 " redefine arglist; go to Xxx1
-:all " open window for all args
-:w! test.out " Write contents of Xxx1
-:w >>test.out " Append contents of last window (Xxx1)
-:rew " should now be in Xxx2
-:w >>test.out " Append contents of Xxx2
-:qa!
-ENDTEST
-
-start of test file Xxx
- this is a test
- this is a test
- this is a test
- this is a test
-end of test file Xxx
diff --git a/src/nvim/testdir/test6.ok b/src/nvim/testdir/test6.ok
deleted file mode 100644
index b6b0c93e4e..0000000000
--- a/src/nvim/testdir/test6.ok
+++ /dev/null
@@ -1,18 +0,0 @@
-start of test file Xxx1
- this is a test
- this is a test
- 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
- this is a test
- this is a test
-end of test file Xxx
-start of test file Xxx2
- this is a test
- this is a test
- this is a test
- this is a test
-end of test file Xxx
diff --git a/test/functional/legacy/006_argument_list_spec.lua b/test/functional/legacy/006_argument_list_spec.lua
new file mode 100644
index 0000000000..30fb9a55ff
--- /dev/null
+++ b/test/functional/legacy/006_argument_list_spec.lua
@@ -0,0 +1,81 @@
+-- Test for autocommand that redefines the argument list, when doing ":all".
+
+local helpers = require('test.functional.helpers')
+local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
+local execute, dedent, eq = helpers.execute, helpers.dedent, helpers.eq
+local curbuf_contents = helpers.curbuf_contents
+
+describe('argument list', function()
+ setup(clear)
+
+ it('is working', function()
+ insert([[
+ start of test file Xxx
+ this is a test
+ this is a test
+ this is a test
+ this is a test
+ end of test file Xxx]])
+
+ execute('au BufReadPost Xxx2 next Xxx2 Xxx1')
+ execute('/^start of')
+
+ -- Write test file Xxx1
+ feed('A1<Esc>:.,/end of/w! Xxx1<cr>')
+
+ -- Write test file Xxx2
+ feed('$r2:.,/end of/w! Xxx2<cr>')
+
+ -- Write test file Xxx3
+ feed('$r3:.,/end of/w! Xxx3<cr>')
+
+ -- Redefine arglist; go to Xxx1
+ execute('next! Xxx1 Xxx2 Xxx3')
+
+ -- Open window for all args
+ execute('all')
+
+ -- Write contents of Xxx1
+ execute('%yank A')
+
+ -- Append contents of last window (Xxx1)
+ feed('')
+ execute('%yank A')
+
+ -- should now be in Xxx2
+ execute('rew')
+
+ -- Append contents of Xxx2
+ execute('%yank A')
+
+ execute('%d')
+ execute('0put=@a')
+ execute('1d | $d')
+
+ eq(dedent([[
+ start of test file Xxx1
+ this is a test
+ this is a test
+ 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
+ this is a test
+ this is a test
+ end of test file Xxx
+ start of test file Xxx2
+ this is a test
+ this is a test
+ this is a test
+ this is a test
+ end of test file Xxx]]), curbuf_contents())
+ end)
+
+ teardown(function()
+ os.remove('Xxx1')
+ os.remove('Xxx2')
+ os.remove('Xxx3')
+ end)
+end)