summaryrefslogtreecommitdiff
path: root/t/pragma
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1998-10-21 13:03:57 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1998-10-21 13:03:57 +0000
commit31dfa2f67cc0c743af923d5a6fe0b0f44ad42013 (patch)
tree70529d5aa56428b075ef625e22beb0da2f38f658 /t/pragma
parent9bbd4fab969be820145f86437927ebc1afa5896b (diff)
parent62b1ebc20082e645ed8e8a0cc6c1ebf91577cd34 (diff)
downloadperl-31dfa2f67cc0c743af923d5a6fe0b0f44ad42013.tar.gz
yielding, the saga continues.
p4raw-id: //depot/cfgperl@2032
Diffstat (limited to 't/pragma')
-rwxr-xr-xt/pragma/constant.t18
1 files changed, 17 insertions, 1 deletions
diff --git a/t/pragma/constant.t b/t/pragma/constant.t
index 0b58bae607..5b63dfacc2 100755
--- a/t/pragma/constant.t
+++ b/t/pragma/constant.t
@@ -14,7 +14,7 @@ END { print @warnings }
######################### We start with some black magic to print on failure.
-BEGIN { $| = 1; print "1..39\n"; }
+BEGIN { $| = 1; print "1..46\n"; }
END {print "not ok 1\n" unless $loaded;}
use constant;
$loaded = 1;
@@ -139,3 +139,19 @@ test 37, @warnings &&
test 38, @warnings == 0, "unexpected warning";
test 39, $^W & 1, "Who disabled the warnings?";
+
+use constant CSCALAR => \"ok 40\n";
+use constant CHASH => { foo => "ok 41\n" };
+use constant CARRAY => [ undef, "ok 42\n" ];
+use constant CPHASH => [ { foo => 1 }, "ok 43\n" ];
+use constant CCODE => sub { "ok $_[0]\n" };
+
+print ${+CSCALAR};
+print CHASH->{foo};
+print CARRAY->[1];
+print CPHASH->{foo};
+eval q{ CPHASH->{bar} };
+test 44, scalar($@ =~ /^No such array/);
+print CCODE->(45);
+eval q{ CCODE->{foo} };
+test 46, scalar($@ =~ /^Constant is not a HASH/);