]> granicus.if.org Git - vim/commitdiff
patch 7.4.1127 v7.4.1127
authorBram Moolenaar <Bram@vim.org>
Sun, 17 Jan 2016 21:05:48 +0000 (22:05 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 17 Jan 2016 21:05:48 +0000 (22:05 +0100)
Problem:    Both old and new style tests for Perl.
Solution:   Merge the old tests with the new style tests.

src/Makefile
src/testdir/Make_all.mak
src/testdir/test_perl.in [deleted file]
src/testdir/test_perl.ok [deleted file]
src/testdir/test_perl.vim
src/version.c

index b23237ca487d7ac1c181ab67a5fe4e288184a1f0..7b0cd297fdd17c351d7aea3546e0f045c874ee01 100644 (file)
@@ -1931,7 +1931,7 @@ unittest unittests: $(UNITTEST_TARGETS)
                ./$$t || exit 1; echo $$t passed; \
        done
 
-# Run individual test, assuming that Vim was already compiled.
+# Run individual OLD style test, assuming that Vim was already compiled.
 test1 \
        test_argument_0count \
        test_argument_count \
@@ -1956,7 +1956,6 @@ test1 \
        test_match_conceal \
        test_nested_function \
        test_options \
-       test_perl \
        test_qf_title \
        test_ruby \
        test_search_mbyte \
@@ -1979,7 +1978,9 @@ test1 \
        test100 test101 test102 test103 test104 test105 test106 test107 test108:
        cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
 
-test_assert \
+# Run individual NEW style test, assuming that Vim was already compiled.
+test_arglist \
+       test_assert \
        test_backspace_opt \
        test_cdo \
        test_cursor_func \
@@ -1989,6 +1990,7 @@ test_assert \
        test_increment \
        test_lispwords \
        test_menu \
+       test_perl \
        test_quickfix \
        test_searchpos \
        test_set \
index 583bf0b56c763193aaf6fd4d432d68a50e04e71e..33d76ba49edc62ed6b24957821d8ebc375a23ba3 100644 (file)
@@ -113,7 +113,6 @@ SCRIPTS_ALL = \
        test_match_conceal.out \
        test_nested_function.out \
        test_options.out \
-       test_perl.out \
        test_qf_title.out \
        test_ruby.out \
        test_search_mbyte.out \
diff --git a/src/testdir/test_perl.in b/src/testdir/test_perl.in
deleted file mode 100644 (file)
index c028606..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-Tests for perl interface.     vim: set ft=vim :
-
-STARTTEST
-:so small.vim
-:set nocompatible viminfo+=nviminfo
-:if !has('perl') | e! test.ok | wq! test.out | endif
-:" change buffer contents
-:perl VIM::DoCommand("normal /^1\n")
-:perl $curline = VIM::Eval("line('.')")
-:perl $curbuf->Set($curline, "1 changed line 1")
-:" evaluate a List
-:perl VIM::DoCommand("normal /^2\n")
-:perl $curline = VIM::Eval("line('.')")
-:let l = ["abc", "def"]
-:perl << EOF
-$l = VIM::Eval("l");
-$curbuf->Append($curline, $l);
-EOF
-:normal j
-:.perldo s|\n|/|g
-:?^1?,$w! test.out
-:qa!
-ENDTEST
-
-1 line 1
-2 line 2
diff --git a/src/testdir/test_perl.ok b/src/testdir/test_perl.ok
deleted file mode 100644 (file)
index 432cdd9..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-1 changed line 1
-2 line 2
-abc/def/
index 3741fc7d5dcb7410b4011c9c93211b8f1bdd82a4..79e24f4ac8f53bc46427ad1c8b4607d045d18041 100644 (file)
@@ -4,7 +4,27 @@ if !has('perl')
   finish
 end
 
-set nocp viminfo+=nviminfo
+func Test_change_buffer()
+  call setline(line('$'), ['1 line 1'])
+  perl VIM::DoCommand("normal /^1\n")
+  perl $curline = VIM::Eval("line('.')")
+  perl $curbuf->Set($curline, "1 changed line 1")
+  call assert_equal('1 changed line 1', getline('$'))
+endfunc
+
+func Test_evaluate_list()
+  call setline(line('$'), ['2 line 2'])
+  perl VIM::DoCommand("normal /^2\n")
+  perl $curline = VIM::Eval("line('.')")
+  let l = ["abc", "def"]
+  perl << EOF
+  $l = VIM::Eval("l");
+  $curbuf->Append($curline, $l);
+EOF
+  normal j
+  .perldo s|\n|/|g
+  call assert_equal('abc/def/', getline('$'))
+endfunc
 
 fu <SID>catch_peval(expr)
   try
index a444e46fd761b6cc4dbadf7fa7f59e97d9c8f7cc..61393c2e4c8a34fb89026c4890ac2462d4a73de5 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1127,
 /**/
     1126,
 /**/