summaryrefslogtreecommitdiff
path: root/t/lib
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-12-18 15:57:39 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-18 15:57:39 +0000
commit04af519a09618f7521d633ce560c35c0bfa7db77 (patch)
treef2ee4bba0a617f4c38d1191152f5833d513a5319 /t/lib
parent390b6567b5cb4ff70401b2f35c890d758f2e406e (diff)
parent8aacddc1ea3837f8f1a911d90c644451fc7cfc86 (diff)
downloadperl-04af519a09618f7521d633ce560c35c0bfa7db77.tar.gz
Integrate perlio:
[ 13760] Tidied version of Jeffrey Friedl's <jfriedl@yahoo.com> restricted hashes - added delete of READONLY value inhibit & test for same - re-tabbed p4raw-link: @13760 on //depot/perlio: 8aacddc1ea3837f8f1a911d90c644451fc7cfc86 p4raw-id: //depot/perl@13761
Diffstat (limited to 't/lib')
-rw-r--r--t/lib/access.t17
1 files changed, 14 insertions, 3 deletions
diff --git a/t/lib/access.t b/t/lib/access.t
index b82b3e9271..815808c387 100644
--- a/t/lib/access.t
+++ b/t/lib/access.t
@@ -6,7 +6,7 @@ BEGIN {
}
$| = 1;
-print "1..15\n";
+print "1..19\n";
my $t = 1;
@@ -30,6 +30,8 @@ ok(!access::readonly(%hash));
ok(!access::readonly(%hash,1));
+ok(!access::readonly($hash{two},1));
+
eval { $hash{'three'} = 3 };
#warn "$@";
ok($@ =~ /^Attempt to access to key 'three' in fixed hash/);
@@ -43,11 +45,20 @@ eval { $hash{"\x{2323}"} = 3 };
ok($@ =~ /^Attempt to access to key '(.*)' in fixed hash/);
#ok(ord($1) == 0x2323);
+eval { delete $hash{'two'}};
+#warn "$@";
+ok($@);
+
eval { delete $hash{'one'}};
+ok(not $@);
+
+ok($hash{two} == 2);
+
+eval { delete $hash{'four'}};
#warn "$@";
-ok($@ =~ /^Attempt to access to key 'one' in fixed hash/);
+ok($@ =~ /^Attempt to access to key 'four' in fixed hash/);
-ok(exists $hash{'one'});
+ok(not exists $hash{'one'});
ok(!exists $hash{'three'});