This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Urk. Joe's patches were for the maint branch,
[perl5.git] / lib / English.t
index 6f1520c..d7466c2 100755 (executable)
@@ -6,7 +6,7 @@ BEGIN {
     @INC = '../lib';
 }
 
-use Test::More tests => 54;
+use Test::More tests => 55;
 
 use English qw( -no_match_vars ) ;
 use Config;
@@ -128,7 +128,7 @@ is( $keys[1], 'd|e|f', '$SUBSCRIPT_SEPARATOR' );
 eval { is( $EXCEPTIONS_BEING_CAUGHT, 1, '$EXCEPTIONS_BEING_CAUGHT' ) };
 ok( !$EXCEPTIONS_BEING_CAUGHT, '$EXCEPTIONS_BEING_CAUGHT should be false' );
 
-eval { open('') };
+eval { local *F; my $f = 'asdasdasd'; ++$f while -e $f; open(F, $f); };
 is( $OS_ERROR, $ERRNO, '$OS_ERROR' );
 ok( $OS_ERROR{ENOENT}, '%OS_ERROR (ENOENT should be set)' );
 
@@ -142,6 +142,12 @@ main::is( $PREMATCH, 'a', '$PREMATCH defined' );
 main::is( $MATCH, 'b', '$MATCH defined' );
 main::is( $POSTMATCH, 'c', '$POSTMATCH defined' );
 
+{
+    my $s = "xyz";
+    $s =~ s/y/t$MATCH/;
+    main::is( $s, "xtyz", '$MATCH defined in right side of s///' );
+}
+
 package C;
 
 use English qw( -no_match_vars ) ;