patch 7.4.2307
Problem:    Several tests are old style.
Solution:   Turn them into new style tests. (Yegappan Lakshmanan)
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak
index 76f86ec..6f14f1b 100644
--- a/src/testdir/Make_all.mak
+++ b/src/testdir/Make_all.mak
@@ -42,7 +42,6 @@
 	test43.out \
 	test44.out \
 	test45.out \
-	test46.out \
 	test48.out \
 	test51.out \
 	test53.out \
@@ -64,7 +63,6 @@
 	test77.out \
 	test79.out \
 	test80.out \
-	test81.out \
 	test82.out \
 	test84.out \
 	test88.out \
@@ -77,7 +75,6 @@
 	test98.out \
 	test99.out \
 	test101.out \
-	test102.out \
 	test103.out \
 	test104.out \
 	test107.out \
@@ -157,11 +154,13 @@
 	    test_bufwintabinfo.res \
 	    test_cdo.res \
 	    test_channel.res \
+	    test_charsearch.res \
 	    test_cmdline.res \
 	    test_cscope.res \
 	    test_diffmode.res \
 	    test_digraph.res \
 	    test_farsi.res \
+	    test_fnameescape.res \
 	    test_gn.res \
 	    test_gui.res \
 	    test_hardcopy.res \
@@ -185,6 +184,7 @@
 	    test_startup.res \
 	    test_startup_utf8.res \
 	    test_stat.res \
+	    test_substitute.res \
 	    test_syntax.res \
 	    test_textobjects.res \
 	    test_undo.res \
diff --git a/src/testdir/test102.in b/src/testdir/test102.in
deleted file mode 100644
index 33b4019..0000000
--- a/src/testdir/test102.in
+++ /dev/null
@@ -1,13 +0,0 @@
-Test if fnameescape is correct for special chars like !
-
-STARTTEST
-:so small.vim
-:%d
-:let fname = 'Xspa ce'
-:try | exe "w! " . fnameescape(fname) | put='Space' | endtry 
-:let fname = 'Xemark!'
-:try | exe "w! " . fnameescape(fname) | put='ExclamationMark' | endtry
-:w! test.out
-:qa!
-ENDTEST
-
diff --git a/src/testdir/test102.ok b/src/testdir/test102.ok
deleted file mode 100644
index a25fea1..0000000
--- a/src/testdir/test102.ok
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Space
-ExclamationMark
diff --git a/src/testdir/test46.in b/src/testdir/test46.in
deleted file mode 100644
index 9a9db74..0000000
--- a/src/testdir/test46.in
+++ /dev/null
@@ -1,27 +0,0 @@
-Tests for multi-line regexps with ":s". vim: set ft=vim :
-
-STARTTEST
-:" test if replacing a line break works with a back reference
-:/^1/,/^2/s/\n\(.\)/ \1/
-:" test if inserting a line break works with a back reference
-:/^3/,/^4/s/\(.\)$/\r\1/
-:" test if replacing a line break with another line break works
-:/^5/,/^6/s/\(\_d\{3}\)/x\1x/
-:/^1/,$w! test.out
-:qa!
-ENDTEST
-
-1 aa
-bb
-cc
-2 dd
-ee
-3 ef
-gh
-4 ij
-5 a8
-8b c9
-9d
-6 e7
-77f
-xxxxx
diff --git a/src/testdir/test46.ok b/src/testdir/test46.ok
deleted file mode 100644
index 71b353d..0000000
--- a/src/testdir/test46.ok
+++ /dev/null
@@ -1,13 +0,0 @@
-1 aa bb cc 2 dd ee
-3 e
-f
-g
-h
-4 i
-j
-5 ax8
-8xb cx9
-9xd
-6 ex7
-7x7f
-xxxxx
diff --git a/src/testdir/test81.in b/src/testdir/test81.in
deleted file mode 100644
index 82a6892..0000000
--- a/src/testdir/test81.in
+++ /dev/null
@@ -1,22 +0,0 @@
-Test for t movement command and 'cpo-;' setting
-
-STARTTEST
-:set nocompatible viminfo+=nviminfo
-:set cpo-=;
-/firstline/
-j0tt;D
-0fz;D
-$Fy;D
-$Ty;D:set cpo+=;
-j0tt;;D
-$Ty;;D:?firstline?+1,$w! test.out
-:qa!
-ENDTEST
-
-firstline
-aaa two three four
-    zzz
-yyy   
-bbb yee yoo four
-ccc two three four
-ddd yee yoo four
diff --git a/src/testdir/test81.ok b/src/testdir/test81.ok
deleted file mode 100644
index e9f17dc..0000000
--- a/src/testdir/test81.ok
+++ /dev/null
@@ -1,6 +0,0 @@
-aaa two
-    z
-y
-bbb y
-ccc
-ddd yee y
diff --git a/src/testdir/test_charsearch.in b/src/testdir/test_charsearch.in
deleted file mode 100644
index 4643a55..0000000
--- a/src/testdir/test_charsearch.in
+++ /dev/null
@@ -1,26 +0,0 @@
-Test for character searches
-
-STARTTEST
-:so small.vim
-:" check that "fe" and ";" work
-/^X
-ylfep;;p,,p:
-:" check that save/restore works
-/^Y
-ylfep:let csave = getcharsearch()
-fip:call setcharsearch(csave)
-;p;p:
-:" check that setcharsearch() changes the settings.
-/^Z
-ylfep:call setcharsearch({'char': 'k'})
-;p:call setcharsearch({'forward': 0})
-$;p:call setcharsearch({'until': 1})
-:set cpo-=;
-;;p:
-:/^X/,$w! test.out
-:qa!
-ENDTEST
-
-Xabcdefghijkemnopqretuvwxyz
-Yabcdefghijkemnopqretuvwxyz
-Zabcdefghijkemnokqretkvwxyz
diff --git a/src/testdir/test_charsearch.ok b/src/testdir/test_charsearch.ok
deleted file mode 100644
index 3b1843e..0000000
--- a/src/testdir/test_charsearch.ok
+++ /dev/null
@@ -1,3 +0,0 @@
-XabcdeXfghijkeXmnopqreXtuvwxyz
-YabcdeYfghiYjkeYmnopqreYtuvwxyz
-ZabcdeZfghijkZZemnokqretkZvwxyz
diff --git a/src/testdir/test_charsearch.vim b/src/testdir/test_charsearch.vim
new file mode 100644
index 0000000..115659a
--- /dev/null
+++ b/src/testdir/test_charsearch.vim
@@ -0,0 +1,62 @@
+
+function! Test_charsearch()
+  enew!
+  call append(0, ['Xabcdefghijkemnopqretuvwxyz',
+      	\ 'Yabcdefghijkemnopqretuvwxyz',
+      	\ 'Zabcdefghijkemnokqretkvwxyz'])
+  " check that "fe" and ";" work
+  1
+  normal! ylfep;;p,,p
+  call assert_equal('XabcdeXfghijkeXmnopqreXtuvwxyz', getline(1))
+  " check that save/restore works
+  2
+  normal! ylfep
+  let csave = getcharsearch()
+  normal! fip
+  call setcharsearch(csave)
+  normal! ;p;p
+  call assert_equal('YabcdeYfghiYjkeYmnopqreYtuvwxyz', getline(2))
+
+  " check that setcharsearch() changes the settings.
+  3
+  normal! ylfep
+  call setcharsearch({'char': 'k'})
+  normal! ;p
+  call setcharsearch({'forward': 0})
+  normal! $;p
+  call setcharsearch({'until': 1})
+  set cpo-=;
+  normal! ;;p
+  call assert_equal('ZabcdeZfghijkZZemnokqretkZvwxyz', getline(3))
+  enew!
+endfunction
+
+" Test for t,f,F,T movement commands and 'cpo-;' setting
+function! Test_search_cmds()
+  enew!
+  call append(0, ["aaa two three four", "    zzz", "yyy   ",
+	      \ "bbb yee yoo four", "ccc two three four",
+	      \ "ddd yee yoo four"])
+  set cpo-=;
+  1
+  normal! 0tt;D
+  2
+  normal! 0fz;D
+  3
+  normal! $Fy;D
+  4
+  normal! $Ty;D
+  set cpo+=;
+  5
+  normal! 0tt;;D
+  6
+  normal! $Ty;;D
+
+  call assert_equal('aaa two', getline(1))
+  call assert_equal('    z', getline(2))
+  call assert_equal('y', getline(3))
+  call assert_equal('bbb y', getline(4))
+  call assert_equal('ccc', getline(5))
+  call assert_equal('ddd yee y', getline(6))
+  enew!
+endfunction
diff --git a/src/testdir/test_fnameescape.vim b/src/testdir/test_fnameescape.vim
new file mode 100644
index 0000000..ce2cd3f
--- /dev/null
+++ b/src/testdir/test_fnameescape.vim
@@ -0,0 +1,21 @@
+
+" Test if fnameescape is correct for special chars like !
+function! Test_fnameescape()
+  let fname = 'Xspa ce'
+  let status = v:false
+  try
+    exe "w! " . fnameescape(fname)
+    let status = v:true
+  endtry 
+  call assert_true(status, "Space")
+  call delete(fname)
+
+  let fname = 'Xemark!'
+  let status = v:false
+  try
+    exe "w! " . fnameescape(fname)
+    let status = v:true
+  endtry
+  call assert_true(status, "ExclamationMark")
+  call delete(fname)
+endfunction
diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim
new file mode 100644
index 0000000..e2b6de0
--- /dev/null
+++ b/src/testdir/test_substitute.vim
@@ -0,0 +1,41 @@
+" Tests for multi-line regexps with ":s".
+
+function! Test_multiline_subst()
+  enew!
+  call append(0, ["1 aa",
+	      \ "bb",
+	      \ "cc",
+	      \ "2 dd",
+	      \ "ee",
+	      \ "3 ef",
+	      \ "gh",
+	      \ "4 ij",
+	      \ "5 a8",
+	      \ "8b c9",
+	      \ "9d",
+	      \ "6 e7",
+	      \ "77f",
+	      \ "xxxxx"])
+
+  1
+  " test if replacing a line break works with a back reference
+  /^1/,/^2/s/\n\(.\)/ \1/
+  " test if inserting a line break works with a back reference
+  /^3/,/^4/s/\(.\)$/\r\1/
+  " test if replacing a line break with another line break works
+  /^5/,/^6/s/\(\_d\{3}\)/x\1x/
+  call assert_equal('1 aa bb cc 2 dd ee', getline(1))
+  call assert_equal('3 e', getline(2))
+  call assert_equal('f', getline(3))
+  call assert_equal('g', getline(4))
+  call assert_equal('h', getline(5))
+  call assert_equal('4 i', getline(6))
+  call assert_equal('j', getline(7))
+  call assert_equal('5 ax8', getline(8))
+  call assert_equal('8xb cx9', getline(9))
+  call assert_equal('9xd', getline(10))
+  call assert_equal('6 ex7', getline(11))
+  call assert_equal('7x7f', getline(12))
+  call assert_equal('xxxxx', getline(13))
+  enew!
+endfunction