summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/Make_amiga.mak2
-rw-r--r--src/testdir/Make_dos.mak1
-rw-r--r--src/testdir/Make_ming.mak1
-rw-r--r--src/testdir/Make_os2.mak1
-rw-r--r--src/testdir/Make_vms.mms1
-rw-r--r--src/testdir/Makefile1
-rw-r--r--src/testdir/test_increment.in143
-rw-r--r--src/testdir/test_increment.ok66
8 files changed, 216 insertions, 0 deletions
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index d9385b214d..5d80c4baa4 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -45,6 +45,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test_command_count.out \
test_erasebackword.out \
test_eval.out \
+ test_increment.out \
test_insertcount.out \
test_listchars.out \
test_listlbr.out \
@@ -192,6 +193,7 @@ test_close_count.out: test_close_count.in
test_command_count.out: test_command_count.in
test_erasebackword.out: test_erasebackword.in
test_eval.out: test_eval.in
+test_increment.out: test_increment.in
test_insertcount.out: test_insertcount.in
test_listchars.out: test_listchars.in
test_listlbr.out: test_listlbr.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index 931784f1b9..219b4bc9bc 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -44,6 +44,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test_command_count.out \
test_erasebackword.out \
test_eval.out \
+ test_increment.out \
test_insertcount.out \
test_listchars.out \
test_listlbr.out \
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index fde59fe85d..ba28cb5f6f 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -66,6 +66,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test_command_count.out \
test_erasebackword.out \
test_eval.out \
+ test_increment.out \
test_insertcount.out \
test_listchars.out \
test_listlbr.out \
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index 5a59cf5df9..52addeef04 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -46,6 +46,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test_command_count.out \
test_erasebackword.out \
test_eval.out \
+ test_increment.out \
test_insertcount.out \
test_listchars.out \
test_listlbr.out \
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 427954e6ca..6d1f73b460 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -105,6 +105,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
test_command_count.out \
test_erasebackword.out \
test_eval.out \
+ test_increment.out \
test_insertcount.out \
test_listchars.out \
test_listlbr.out \
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 420ed6a9e0..f0a2138702 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -42,6 +42,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test_command_count.out \
test_erasebackword.out \
test_eval.out \
+ test_increment.out \
test_insertcount.out \
test_listchars.out \
test_listlbr.out \
diff --git a/src/testdir/test_increment.in b/src/testdir/test_increment.in
new file mode 100644
index 0000000000..5b0ad06cf8
--- /dev/null
+++ b/src/testdir/test_increment.in
@@ -0,0 +1,143 @@
+Tests for using Ctrl-A/Ctrl-X on visual selections
+
+Test cases
+==========
+
+1) Ctrl-A on visually selected number
+Text:
+foobar-10
+ 1) Ctrl-A on start of line:
+ foobar-9
+ 2) Ctrl-A on visually selected "-10":
+ foobar-9
+ 3) Ctrl-A on visually selected "10":
+ foobar-11
+ 4) Ctrl-X on visually selected "-10"
+ foobar-11
+ 5) Ctrl-X on visually selected "10"
+ foobar-9
+
+2) Ctrl-A on visually selected lines
+Text:
+10
+20
+30
+40
+
+ 1) Ctrl-A on visually selected lines:
+11
+21
+31
+41
+
+ 2) Ctrl-X on visually selected lines:
+9
+19
+29
+39
+
+3) g Ctrl-A on visually selected lines, with non-numbers in between
+Text:
+10
+
+20
+
+30
+
+40
+
+ 1) 2 g Ctrl-A on visually selected lines:
+12
+
+24
+
+36
+
+48
+ 2) 2 g Ctrl-X on visually selected lines
+8
+
+16
+
+24
+
+32
+
+4) Ctrl-A on non-number
+Text:
+foobar-10
+ 1) visually select foobar:
+ foobar-10
+
+STARTTEST
+:so small.vim
+
+:" Test 1
+:/^S1=/+,/^E1=/-y a
+:/^E1/+put a
+:/^E1/+2put a
+f-v$:/^E1/+3put a
+f1v$:/^E1/+4put a
+f-v$:/^E1/+5put a
+f1v$
+
+:" Test 22
+:/^S2=/+,/^E2=/-y a
+:/^E2/+put a
+V3k$:.+put a
+V3k$
+
+:" Test 3
+:/^S3=/+,/^E3=/-y a
+:/^E3=/+put a
+V6k2g:.+put a
+V6k2g
+
+:" Test 4
+:/^S4=/+,/^E4=/-y a
+:/^E4=/+put a
+vf-
+
+:" Save the report
+:/^# Test 1/,$w! test.out
+:qa!
+
+
+# Test 1
+S1======
+foobar-10
+E1======
+
+
+
+# Test 2
+S2=====
+10
+20
+30
+40
+E2=====
+
+
+
+# Test 3
+S3=====
+10
+
+20
+
+30
+
+40
+E3=====
+
+
+
+# Test 4
+S4=====
+foobar-10
+E4=====
+
+
+ENDTEST
+
diff --git a/src/testdir/test_increment.ok b/src/testdir/test_increment.ok
new file mode 100644
index 0000000000..4a61ad1d1d
--- /dev/null
+++ b/src/testdir/test_increment.ok
@@ -0,0 +1,66 @@
+# Test 1
+S1======
+foobar-10
+E1======
+
+foobar-9
+foobar-9
+foobar-11
+foobar-11
+foobar-9
+
+
+# Test 2
+S2=====
+10
+20
+30
+40
+E2=====
+
+11
+21
+31
+41
+
+9
+19
+29
+39
+
+# Test 3
+S3=====
+10
+
+20
+
+30
+
+40
+E3=====
+
+12
+
+24
+
+36
+
+48
+
+8
+
+16
+
+24
+
+32
+
+# Test 4
+S4=====
+foobar-10
+E4=====
+
+foobar-10
+
+ENDTEST
+