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

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

is_vodafone and is_softbank is now aliased

  • 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 => 36;
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     'foo@softbank.ne.jp',
15 );
16
17 my @ok_ezweb = (
18     'foo@ezweb.ne.jp',
19     'foo@hoge.ezweb.ne.jp',
20 );
21
22 my @ok_softbank = (
23     'foo@softbank.ne.jp',
24     'foo@d.vodafone.ne.jp',
25 );
26
27 my @ok = (
28     @ok_imode,
29     @ok_vodafone,
30     @ok_ezweb,
31     @ok_softbank,
32     'foo@mnx.ne.jp',
33     'foo@bar.mnx.ne.jp',
34     'foo@dct.dion.ne.jp',
35     'foo@sky.tu-ka.ne.jp',
36     'foo@bar.sky.tkc.ne.jp',
37     'foo@em.nttpnet.ne.jp',
38     'foo@bar.em.nttpnet.ne.jp',
39     'foo@pdx.ne.jp',
40     'foo@dx.pdx.ne.jp',
41     'foo@phone.ne.jp',
42     'foo@bar.mozio.ne.jp',
43     'foo@p1.foomoon.com',
44     'foo@x.i-get.ne.jp',
45     'foo@ez1.ido.ne.jp',
46     'foo@cmail.ido.ne.jp',
47     Mail::Address->parse('foo <foo@p1.foomoon.com>'),
48 );
49
50 my @not = (
51     'foo@example.com',
52     'foo@dxx.pdx.ne.jp',
53     'barabr',
54     Mail::Address->parse('foo <foo@doo.com>'),
55 );
56
57 for my $ok (@ok_imode) {
58     ok is_imode($ok), "$ok";
59 }
60
61 for my $ok (@ok_vodafone) {
62     ok is_vodafone($ok), "$ok";
63 }
64
65 for my $ok (@ok_ezweb) {
66     ok is_ezweb($ok), "$ok";
67 }
68
69 for my $ok (@ok_softbank) {
70     ok is_softbank($ok), "$ok";
71 }
72
73 for my $ok (@ok) {
74     ok is_mobile_jp($ok), "$ok";
75 }
76
77 for my $not (@not) {
78     ok !is_mobile_jp($not), "$not";
79 }
Note: See TracBrowser for help on using the browser.