Skip to content

Commit

Permalink
parcing out extended invert
Browse files Browse the repository at this point in the history
  • Loading branch information
xsawyerx committed Jun 10, 2010
1 parent 65379ca commit 61db021
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
24 changes: 24 additions & 0 deletions t/extend_invert.t
@@ -0,0 +1,24 @@
#!perl

# checking that invertion works the way we think it should

use strict;
use warnings;
use Test::More tests => 3;
use Test::Exception;
use Net::IPAddress::Minimal 'invert_ip';

{
no warnings qw/redefine once/;

*Net::IPAddress::Minimal::test_string_structure = sub {
cmp_ok( scalar @_, '==', 1, 'no. of param test_string_structure()' );
is( $_[0], 'test', 'correct param for test_string_structure()' );
return 'waka waka';
};
}

throws_ok { invert_ip('test') }
qr{^Could not convert IP string / number due to unknown error},
'invert_ip() can really die';

17 changes: 1 addition & 16 deletions t/invert.t
Expand Up @@ -4,9 +4,8 @@

use strict;
use warnings;
use Test::More tests => 9;
use Test::More tests => 6;
use Net::IPAddress::Minimal 'invert_ip';
use Test::Exception;

my $ip_a = '7.91.205.21';
my $ip_num = 123456789;
Expand Down Expand Up @@ -40,17 +39,3 @@ is(
'got empty string from invert_ip()',
);

{
no warnings qw/redefine once/;

*Net::IPAddress::Minimal::test_string_structure = sub {
cmp_ok( scalar @_, '==', 1, 'no. of param test_string_structure()' );
is( $_[0], 'test', 'correct param for test_string_structure()' );
return 'waka waka';
};
}

throws_ok { invert_ip('test') }
qr{^Could not convert IP string / number due to unknown error},
'invert_ip() can really die';

0 comments on commit 61db021

Please sign in to comment.