|
Revision 10087, 1.4 kB
(checked in by hanekomu, 5 years ago)
|
|
lang/perl/Business-Address-POBox: initial import
|
| Line | |
|---|
| 1 | #!/usr/bin/env perl |
|---|
| 2 | |
|---|
| 3 | use warnings; |
|---|
| 4 | use strict; |
|---|
| 5 | use Business::Address::POBox; |
|---|
| 6 | use Test::More; |
|---|
| 7 | use Test::Exception; |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | my @is_not_pobox = ( |
|---|
| 11 | 'Post Road 123', |
|---|
| 12 | 'Post Rd 123', |
|---|
| 13 | 'Post Street 123', |
|---|
| 14 | 'Post St 123', |
|---|
| 15 | 'Post Avenue 123', |
|---|
| 16 | 'Post Av 123', |
|---|
| 17 | 'Post Alley 123', |
|---|
| 18 | 'Post Drive 123', |
|---|
| 19 | 'Post Grove 123', |
|---|
| 20 | 'Post Walk 123', |
|---|
| 21 | 'Post Parkway 123', |
|---|
| 22 | 'Post Row 123', |
|---|
| 23 | 'Post Lane 123', |
|---|
| 24 | 'Post Bridge 123', |
|---|
| 25 | 'Post Boulevard 123', |
|---|
| 26 | 'Post Square 123', |
|---|
| 27 | 'Post Garden 123', |
|---|
| 28 | 'Post Strasse 123', |
|---|
| 29 | 'Post Allee 123', |
|---|
| 30 | 'Post Gasse 123', |
|---|
| 31 | 'Post Platz 123', |
|---|
| 32 | 'Postsparkassenplatz 1', |
|---|
| 33 | 'Postelweg 5', |
|---|
| 34 | 'Boxgasse 32', |
|---|
| 35 | 'Postfachplatz 11', |
|---|
| 36 | 'PFalznerweg 91', |
|---|
| 37 | 'aPOSTelweg 12', |
|---|
| 38 | ); |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | my @is_pobox = ( |
|---|
| 42 | 'Box 123', |
|---|
| 43 | 'Pob', |
|---|
| 44 | 'Postbox', |
|---|
| 45 | 'Post', |
|---|
| 46 | 'Postschachtel', |
|---|
| 47 | 'PO 37, Postgasse 5', |
|---|
| 48 | 'P O', |
|---|
| 49 | 'P O BOX', |
|---|
| 50 | 'P.O.', |
|---|
| 51 | 'P.O.B.', |
|---|
| 52 | 'P.O.BOX', |
|---|
| 53 | 'P.O. BOX', |
|---|
| 54 | 'P. O.', |
|---|
| 55 | 'P. O.BOX', |
|---|
| 56 | 'P. O. BOX', |
|---|
| 57 | 'POBOX', |
|---|
| 58 | 'PF 123', |
|---|
| 59 | 'P.F. 37, Post Drive 9', |
|---|
| 60 | 'P.O. BOX 37, Post Drive 9', |
|---|
| 61 | 'Post Street, P.O.B.', |
|---|
| 62 | 'Postfach 41, 1023 Wien', |
|---|
| 63 | 'Post Gasse, Postlagernd', |
|---|
| 64 | 'POSTBUS' |
|---|
| 65 | ); |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | plan tests => @is_not_pobox + @is_pobox; |
|---|
| 69 | |
|---|
| 70 | for my $value (@is_not_pobox) { |
|---|
| 71 | ok(!Business::Address::POBox->new->is_pobox($value), |
|---|
| 72 | "value [$value] is not a pobox"); |
|---|
| 73 | } |
|---|
| 74 | |
|---|
| 75 | for my $value (@is_pobox) { |
|---|
| 76 | ok(Business::Address::POBox->new->is_pobox($value), |
|---|
| 77 | "value [$value] is a pobox"); |
|---|
| 78 | } |
|---|
| 79 | |
|---|