shared hash keys and ++/--
[p5sagit/p5-mst-13.2.git] / t / op / magic.t
index 73dc8a6..4f38623 100755 (executable)
@@ -8,6 +8,7 @@ BEGIN {
 }
 
 use warnings;
+use Config;
 
 my $test = 1;
 sub ok {
@@ -35,7 +36,7 @@ sub skip {
     return 1;
 }
 
-print "1..43\n";
+print "1..44\n";
 
 $Is_MSWin32 = $^O eq 'MSWin32';
 $Is_NetWare = $^O eq 'NetWare';
@@ -71,7 +72,7 @@ if ($Is_MSWin32 || $Is_NetWare || $Is_Dos || $Is_MPE || $Is_MacOS) {
 else {
   # the next tests are done in a subprocess because sh spits out a
   # newline onto stderr when a child process kills itself with SIGINT.
-  # We use a pipe rather than system() because the VMS command buffer 
+  # We use a pipe rather than system() because the VMS command buffer
   # would overflow with a command that long.
 
     open( CMDPIPE, "| $PERL");
@@ -142,13 +143,15 @@ eval { die "foo\n" };
 ok $@ eq "foo\n", $@;
 
 ok $$ > 0, $$;
+eval { $$++ };
+ok $@ =~ /^Modification of a read-only value attempted/;
 
 # $^X and $0
 {
     if ($^O eq 'qnx') {
        chomp($wd = `/usr/bin/fullpath -t`);
     }
-    elsif($Is_Cygwin) {
+    elsif($Is_Cygwin || $Config{'d_procselfexe'}) {
        # Cygwin turns the symlink into the real file
        chomp($wd = `pwd`);
        $wd =~ s#/t$##;