root/Mail-Address-MobileJp/trunk/t/01_mobile.t

Revision 1895 (checked in by miyagawa, 14 years ago)

0.05 release; added softbank.ne.jp

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 use strict;
2 use Test::More tests => 32;
3
4 use Mail::Address;
5 use Mail::Address::MobileJp;
6
7 my @ok_imode = (
8     'foo@docomo.ne.jp',
9 );
10
11 my @ok_vodafone = (
12     'foo@jp-d.ne.jp',
13     'foo@d.vodafone.ne.jp',
14 );
15
16 my @ok_ezweb = (
17     'foo@ezweb.ne.jp',
18     'foo@hoge.ezweb.ne.jp',
19 );
20
21 my @ok_softbank = (
22     'foo@softbank.ne.jp',
23 );
24
25 my @ok = (
26     @ok_imode,
27     @ok_vodafone,
28     @ok_ezweb,
29     @ok_softbank,
30     'foo@mnx.ne.jp',
31     'foo@bar.mnx.ne.jp',
32     'foo@dct.dion.ne.jp',
33     'foo@sky.tu-ka.ne.jp',
34     'foo@bar.sky.tkc.ne.jp',
35     'foo@em.nttpnet.ne.jp',
36     'foo@bar.em.nttpnet.ne.jp',
37     'foo@pdx.ne.jp',
38     'foo@dx.pdx.ne.jp',
39     'foo@phone.ne.jp',
40     'foo@bar.mozio.ne.jp',
41     'foo@p1.foomoon.com',
42     'foo@x.i-get.ne.jp',
43     'foo@ez1.ido.ne.jp',
44     'foo@cmail.ido.ne.jp',
45     Mail::Address->parse('foo <foo@p1.foomoon.com>'),
46 );
47
48 my @not = (
49     'foo@example.com',
50     'foo@dxx.pdx.ne.jp',
51     'barabr',
52     Mail::Address->parse('foo <foo@doo.com>'),
53 );
54
55 for my $ok (@ok_imode) {
56     ok is_imode($ok), "$ok";
57 }
58
59 for my $ok (@ok_vodafone) {
60     ok is_vodafone($ok), "$ok";
61 }
62
63 for my $ok (@ok_ezweb) {
64     ok is_ezweb($ok), "$ok";
65 }
66
67 for my $ok (@ok_softbank) {
68     ok is_softbank($ok), "$ok";
69 }
70
71 for my $ok (@ok) {
72     ok is_mobile_jp($ok), "$ok";
73 }
74
75 for my $not (@not) {
76     ok !is_mobile_jp($not), "$not";
77 }
Note: See TracBrowser for help on using the browser.