aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Hoffmann <l-m-h@web.de>2015-06-11 01:28:27 +0200
committerJustin M. Keyes <justinkz@gmail.com>2015-06-16 01:36:17 -0400
commit55806fbe39fa9fff3ce664dff4c46fc9c6f566fd (patch)
treedaaab0b98f0a4335a7a40c7fd590579c2f6f1042
parentc83af3a88cfbd4480e02b38f1d4d8e38a58a56d5 (diff)
downloadrneovim-55806fbe39fa9fff3ce664dff4c46fc9c6f566fd.tar.gz
rneovim-55806fbe39fa9fff3ce664dff4c46fc9c6f566fd.tar.bz2
rneovim-55806fbe39fa9fff3ce664dff4c46fc9c6f566fd.zip
tests: Migrate legacy test argument_count.
-rw-r--r--src/nvim/testdir/Makefile1
-rw-r--r--src/nvim/testdir/test_argument_count.in46
-rw-r--r--src/nvim/testdir/test_argument_count.ok13
-rw-r--r--test/functional/legacy/argument_count_spec.lua64
4 files changed, 64 insertions, 60 deletions
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile
index 023a8bf234..b982dbcbb3 100644
--- a/src/nvim/testdir/Makefile
+++ b/src/nvim/testdir/Makefile
@@ -27,7 +27,6 @@ SCRIPTS := test_eval.out \
test86.out test87.out test88.out \
test_listlbr.out \
test_breakindent.out \
- test_argument_count.out \
test_close_count.out \
test_command_count.out \
diff --git a/src/nvim/testdir/test_argument_count.in b/src/nvim/testdir/test_argument_count.in
deleted file mode 100644
index af91f38375..0000000000
--- a/src/nvim/testdir/test_argument_count.in
+++ /dev/null
@@ -1,46 +0,0 @@
-Tests for :[count]argument! and :[count]argdelete vim: set ft=vim :
-
-STARTTEST
-:%argd
-:argadd a b c d
-:set hidden
-:let buffers = []
-:augroup TEST
-:au BufEnter * call add(buffers, expand('%:t'))
-:augroup END
-:$argu
-:$-argu
-:-argu
-:1argu
-:+2argu
-:augroup TEST
-:au!
-:augroup END
-:let arglists = []
-:.argd
-:call add(arglists, argv())
-:-argd
-:call add(arglists, argv())
-:$argd
-:call add(arglists, argv())
-:1arga c
-:1arga b
-:$argu
-:$arga x
-:call add(arglists, argv())
-:0arga Y
-:call add(arglists, argv())
-:%argd
-:call add(arglists, argv())
-:arga a b c d e f
-:2,$-argd
-:call add(arglists, argv())
-:e! test.out
-:call append(0, buffers)
-:let lnr = line('$')
-:call append(lnr, map(copy(arglists), 'join(v:val, " ")'))
-:w
-:qa!
-ENDTEST
-
-
diff --git a/src/nvim/testdir/test_argument_count.ok b/src/nvim/testdir/test_argument_count.ok
deleted file mode 100644
index f51562620d..0000000000
--- a/src/nvim/testdir/test_argument_count.ok
+++ /dev/null
@@ -1,13 +0,0 @@
-d
-c
-b
-a
-c
-
-a b d
-a d
-a
-a b c x
-Y a b c x
-
-a f
diff --git a/test/functional/legacy/argument_count_spec.lua b/test/functional/legacy/argument_count_spec.lua
new file mode 100644
index 0000000000..ece875d235
--- /dev/null
+++ b/test/functional/legacy/argument_count_spec.lua
@@ -0,0 +1,64 @@
+-- Tests for :[count]argument! and :[count]argdelete
+
+local helpers = require('test.functional.helpers')
+local feed, insert, source = helpers.feed, helpers.insert, helpers.source
+local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
+
+describe('argument_count', function()
+ setup(clear)
+
+ it('is working', function()
+ execute('%argd')
+ execute('argadd a b c d')
+ execute('set hidden')
+ execute('let buffers = []')
+ execute('augroup TEST')
+ execute([[au BufEnter * call add(buffers, expand('%:t'))]])
+ execute('augroup END')
+ execute('$argu')
+ execute('$-argu')
+ execute('-argu')
+ execute('1argu')
+ execute('+2argu')
+ execute('augroup TEST')
+ execute('au!')
+ execute('augroup END')
+ execute('let arglists = []')
+ execute('.argd')
+ execute('call add(arglists, argv())')
+ execute('-argd')
+ execute('call add(arglists, argv())')
+ execute('$argd')
+ execute('call add(arglists, argv())')
+ execute('1arga c')
+ execute('1arga b')
+ execute('$argu')
+ execute('$arga x')
+ execute('call add(arglists, argv())')
+ execute('0arga Y')
+ execute('call add(arglists, argv())')
+ execute('%argd')
+ execute('call add(arglists, argv())')
+ execute('arga a b c d e f')
+ execute('2,$-argd')
+ execute('call add(arglists, argv())')
+ execute('call append(0, buffers)')
+ execute([[let lnr = line('$')]])
+ execute([[call append(lnr, map(copy(arglists), 'join(v:val, " ")'))]])
+ -- Assert buffer contents.
+ expect([=[
+ d
+ c
+ b
+ a
+ c
+
+ a b d
+ a d
+ a
+ a b c x
+ Y a b c x
+
+ a f]=])
+ end)
+end)