t/x2p/s2p.t fix for VMS in UNIX mode
[p5sagit/p5-mst-13.2.git] / t / comp / uproto.t
index 3da64d4..9b908eb 100644 (file)
@@ -6,7 +6,7 @@ BEGIN {
     require "./test.pl";
 }
 
-plan(tests => 36);
+plan(tests => 39);
 
 sub f($$_) { my $x = shift; is("@_", $x) }
 
@@ -55,6 +55,7 @@ g("foo");
 g($expected);
 $_ = $expected;
 g();
+g;
 undef $expected; &g; # $_ not passed
 { $expected = my $_ = "bar"; g() }
 
@@ -74,3 +75,15 @@ sub mymkdir (_;$) { is("@_", $expected, "mymkdir") }
 $expected = $_ = "mydir"; mymkdir();
 mymkdir($expected = "foo");
 $expected = "foo 493"; mymkdir foo => 0755;
+
+# $_ says modifiable, it's not passed by copy
+
+sub double(_) { $_[0] *= 2 }
+$_ = 21;
+double();
+is( $_, 42, '$_ is modifiable' );
+{
+    my $_ = 22;
+    double();
+    is( $_, 44, 'my $_ is modifiable' );
+}