git p4: RCS expansion should not span newlines
[gitweb.git] / t / t9810-git-p4-rcs.sh
index b00ad09d23d8e859d3b52c73579e84ad4620b36c..12b3d814499da0ebf54875157e013ca96da28f38 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-test_description='git-p4 rcs keywords'
+test_description='git p4 rcs keywords'
 
 . ./lib-git-p4.sh
 
@@ -147,7 +147,7 @@ test_expect_success 'scrub ko files differently' '
        )
 '
 
-# hack; git-p4 submit should do it on its own
+# hack; git p4 submit should do it on its own
 test_expect_success 'cleanup after failure' '
        (
                cd "$cli" &&
@@ -155,6 +155,25 @@ test_expect_success 'cleanup after failure' '
        )
 '
 
+# perl $File:: bug check
+test_expect_success 'ktext expansion should not expand multi-line $File::' '
+       (
+               cd "$cli" &&
+               cat >lv.pm <<-\EOF
+               my $wanted = sub { my $f = $File::Find::name;
+                                   if ( -f && $f =~ /foo/ ) {
+               EOF
+               p4 add -t ktext lv.pm &&
+               p4 submit -d "lv.pm"
+       ) &&
+       test_when_finished cleanup_git &&
+       git p4 clone --dest="$git" //depot &&
+       (
+               cd "$git" &&
+               test_cmp "$cli/lv.pm" lv.pm
+       )
+'
+
 #
 # Do not scrub anything but +k or +ko files.  Sneak a change into
 # the cli file so that submit will get a conflict.  Make sure that
@@ -193,7 +212,7 @@ test_expect_success 'do not scrub plain text' '
        )
 '
 
-# hack; git-p4 submit should do it on its own
+# hack; git p4 submit should do it on its own
 test_expect_success 'cleanup after failure 2' '
        (
                cd "$cli" &&
@@ -244,7 +263,7 @@ test_expect_success 'cope with rcs keyword expansion damage' '
                cd "$git" &&
                git config git-p4.skipSubmitEdit true &&
                git config git-p4.attemptRCSCleanup true &&
-               (cd ../cli && p4_append_to_file kwfile1.c) &&
+               (cd "$cli" && p4_append_to_file kwfile1.c) &&
                old_lines=$(wc -l <kwfile1.c) &&
                "$PERL_PATH" -n -i -e "print unless m/Revision:/" kwfile1.c &&
                new_lines=$(wc -l <kwfile1.c) &&