This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add Internals::HvREHASH to expose the rehashing flag
[perl5.git] / t / op / hash.t
CommitLineData
05619474
NC
1#!./perl -w
2
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6 require './test.pl';
7}
8
9use strict;
10
11plan tests => 3;
12
13my %h;
14
15ok (!Internals::HvREHASH(%h), "hash doesn't start with rehash flag on");
16
17foreach (1..10) {
18 $h{"\0"x$_}++;
19}
20
21ok (!Internals::HvREHASH(%h), "10 entries doesn't trigger rehash");
22
23foreach (11..20) {
24 $h{"\0"x$_}++;
25}
26
27ok (Internals::HvREHASH(%h), "20 entries triggers rehash");