Browse files

parcing out extended invert

  • Loading branch information...
1 parent 65379ca commit 61db0219ceb47ab7f6ba49797b644c08851b652a @xsawyerx xsawyerx committed Jun 10, 2010
Showing with 25 additions and 16 deletions.
  1. +24 −0 t/extend_invert.t
  2. +1 −16 t/invert.t
View
24 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';
+
View
17 t/invert.t
@@ -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;
@@ -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.