Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters