*time_r fixes
[p5sagit/p5-mst-13.2.git] / t / op / misc.t
index 881f99d..e7f1623 100755 (executable)
@@ -17,7 +17,7 @@ $tmpfile = "misctmp000";
 1 while -f ++$tmpfile;
 END { while($tmpfile && unlink $tmpfile){} }
 
-$CAT = (($^O eq 'MSWin32') ? '.\perl -e "print <>"' : 'cat');
+$CAT = (($^O eq 'MSWin32') ? '.\perl -e "print <>"' : (($^O eq 'NetWare') ? 'perl -e "print <>"' : 'cat'));
 
 for (@prgs){
     my $switch;
@@ -35,6 +35,9 @@ for (@prgs){
     if ($^O eq 'MSWin32') {
       $results = `.\\perl -I../lib $switch $tmpfile 2>&1`;
     }
+       elsif ($^O eq 'NetWare') {
+      $results = `perl -I../lib $switch $tmpfile 2>&1`;
+    }
     else {
       $results = `./perl $switch $tmpfile 2>&1`;
     }
@@ -45,6 +48,7 @@ for (@prgs){
 # bison says 'parse error' instead of 'syntax error',
 # various yaccs may or may not capitalize 'syntax'.
     $results =~ s/^(syntax|parse) error/syntax error/mig;
+    $results =~ s/\n\n/\n/ if $^O eq 'VMS'; # pipes double these sometimes
     $expected =~ s/\n+$//;
     if ( $results ne $expected ) {
        print STDERR "PROG: $switch\n$prog\n";
@@ -528,35 +532,8 @@ print "ok\n";
 EXPECT
 ok
 ########
-my @l = qw(hello.* world);
-my $x;
-
-foreach $x (@l) {
-    print "before - $x\n";
-    $x = "\Q$x\E";
-    print "quotemeta - $x\n";
-    $x = "\u$x";
-    print "ucfirst - $x\n";
-    $x = "\l$x";
-    print "lcfirst - $x\n";
-    $x = "\U$x\E";
-    print "uc - $x\n";
-    $x = "\L$x\E";
-    print "lc - $x\n";
-}
+# moved to op/lc.t
 EXPECT
-before - hello.*
-quotemeta - hello\.\*
-ucfirst - Hello\.\*
-lcfirst - hello\.\*
-uc - HELLO\.\*
-lc - hello\.\*
-before - world
-quotemeta - world
-ucfirst - World
-lcfirst - world
-uc - WORLD
-lc - world
 ########
 sub f { my $a = 1; my $b = 2; my $c = 3; my $d = 4; next }
 my $x = "foo";
@@ -599,6 +576,16 @@ EOT
 EXPECT
 ok
 ########
+# test that closures generated by eval"" hold on to the CV of the eval""
+# for their entire lifetime
+$code = eval q[
+  sub { eval '$x = "ok 1\n"'; }
+];
+&{$code}();
+print $x;
+EXPECT
+ok 1
+########
 # This test is here instead of pragma/locale.t because
 # the bug depends on in the internal state of the locale
 # settings and pragma/locale messes up that state pretty badly.
@@ -614,7 +601,7 @@ my $have_setlocale = $Config{d_setlocale} eq 'define';
 $have_setlocale = 0 if $@;
 # Visual C's CRT goes silly on strings of the form "en_US.ISO8859-1"
 # and mingw32 uses said silly CRT
-$have_setlocale = 0 if $^O eq 'MSWin32' && $Config{cc} =~ /^(cl|gcc)/i;
+$have_setlocale = 0 if (($^O eq 'MSWin32' || $^O eq 'NetWare') && $Config{cc} =~ /^(cl|gcc)/i);
 exit(0) unless $have_setlocale;
 my @locales;
 if (-x "/usr/bin/locale" && open(LOCALES, "/usr/bin/locale -a|")) {
@@ -737,5 +724,10 @@ sub DESTROY {
 EXPECT
 Bar=ARRAY(0x...)
 ########
+printf "%x %x", unpack "U*", sprintf "\x{1234}%s", "\x{5678}"
+EXPECT
+1234 5678
+########
+# keep this last - doesn't seem to work otherwise?
 eval "a.b.c.d.e.f;sub"
 EXPECT