Final fixes before releasing last developer release
[dbsrgits/DBM-Deep.git] / t / 55_recursion.t
CommitLineData
d3aaaf5e 1use strict;
2use warnings FATAL => 'all';
3
4use Test::More;
5use Test::Exception;
6use t::common qw( new_dbm );
7
8use_ok( 'DBM::Deep' );
9
10my $dbm_factory = new_dbm();
11while ( my $dbm_maker = $dbm_factory->() ) {
12 my $db = $dbm_maker->();
13
14 my $h = {};
15 my $tmp = $h;
bb1daf85 16 for (1..99) { # 98 is ok, 99 is bad.
d3aaaf5e 17 %$tmp = ("" => {});
18 $tmp = $tmp->{""};
19 }
20 lives_ok {
21 $db->{""} = $h;
22 } 'deep recursion causes no errors';
23}
24
25done_testing;