forked from DrHyde/perl-modules-Number-Phone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
subclasses no longer need to register themselves;
- Loading branch information
drhyde
committed
May 27, 2008
1 parent
2a71b26
commit 13825fa
Showing
11 changed files
with
100 additions
and
60 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
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
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
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
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
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
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
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
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
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
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,33 @@ | ||
#!/usr/bin/perl -w | ||
|
||
use Test::More tests => 5; | ||
use Scalar::Util qw(blessed); | ||
|
||
use Number::Phone; | ||
|
||
my $number = Number::Phone->new("+441234567890"); | ||
ok(blessed($number) && $number->isa('Number::Phone::UK'), | ||
"N::P->new() works without specifically loading a country module"); | ||
|
||
$number = Number::Phone->new("+12265550199"); | ||
ok(blessed($number) && $number->isa('Number::Phone::NANP::CA'), | ||
"... and it even works for the NANP!"); | ||
|
||
$number = Number::Phone->new("+18666232282"); | ||
ok(blessed($number) && $number->isa('Number::Phone::NANP'), | ||
"... and it even works for the non-geographic NANP!"); | ||
|
||
# +999 is "Proposed disaster relief (TDR) service", NYI by N::P::Country | ||
ok( | ||
!blessed(Number::Phone->new("+999123")) && | ||
!defined(Number::Phone->new("+999123")), | ||
"A country code not recognised by N::P::Country returns false" | ||
); | ||
# +979 is International Premium Rate Service | ||
ok( | ||
!blessed(Number::Phone->new("+979123")) && | ||
!defined(Number::Phone->new("+979123")), | ||
"A country code whose module we can't find returns false" | ||
); | ||
|
||
# FIXME - Kazakhstan/Russia weirdness |