diff options
author | Nicholas Clark <nick@ccl4.org> | 2003-11-01 14:21:38 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2003-11-01 14:21:38 +0000 |
commit | 05619474c45b1f1e16eb70c1d9f8b991a7ad459a (patch) | |
tree | 46af2aa4ec716ae372d688e7ac26d8bae48dddc4 /t/op | |
parent | 1011f542895f26e864b0395a5884b8095479fed5 (diff) | |
download | perl-05619474c45b1f1e16eb70c1d9f8b991a7ad459a.tar.gz |
Add Internals::HvREHASH to expose the rehashing flag
t/op/hash.t tests that pathological data triggers rehashing
p4raw-id: //depot/perl@21604
Diffstat (limited to 't/op')
-rw-r--r-- | t/op/hash.t | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/t/op/hash.t b/t/op/hash.t new file mode 100644 index 0000000000..3beae8432a --- /dev/null +++ b/t/op/hash.t @@ -0,0 +1,27 @@ +#!./perl -w + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; + require './test.pl'; +} + +use strict; + +plan tests => 3; + +my %h; + +ok (!Internals::HvREHASH(%h), "hash doesn't start with rehash flag on"); + +foreach (1..10) { + $h{"\0"x$_}++; +} + +ok (!Internals::HvREHASH(%h), "10 entries doesn't trigger rehash"); + +foreach (11..20) { + $h{"\0"x$_}++; +} + +ok (Internals::HvREHASH(%h), "20 entries triggers rehash"); |