1use strict; 2use warnings; 3 4use Test::More; 5 6BEGIN { 7 eval "use Test::LeakTrace"; 8 plan skip_all => 'This test requires Test::LeakTrace' if $@; 9} 10 11use RedisDB; 12 13my $srv = IO::Socket::IP->new( LocalAddr => '127.0.0.1', Proto => 'tcp', Listen => 1 ); 14plan skip_all => "Can't start server" unless $srv; 15my $pid = fork; 16 17if ( defined($pid) && $pid == 0 ) { 18 alarm 10; 19 my $cli = $srv->accept; 20 1 while <$cli>; 21 exit 0; 22} 23 24no_leaks_ok { 25 my $redis = RedisDB->new( host => '127.0.0.1', port => $srv->sockport, timeout => 5 ); 26} 27"create/destroy an object"; 28 29done_testing; 30