File: country-test-ar.t

package info (click to toggle)
libnumber-phone-perl 3.6006-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 136,072 kB
  • sloc: perl: 2,719; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 1,661 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/perl -w

use strict;

use lib 't/inc';
use fatalwarnings;

use Number::Phone::Lib;
use Test::More;

END { done_testing(); }

{
    my $np = Number::Phone::Lib->new('AR', '3715 65 4320');
    ok($np->is_fixed_line, '3715 65 4320 is a fixed line without national prefix...');
    ok(!$np->is_mobile, '...it is not a mobile...');
    is($np->format, '+54 3715 65 4320', '...its international format is correct');
    is($np->format_using('National'), '03715 65-4320', '...as is its national format');
}
{
    my $np = Number::Phone::Lib->new('AR', '0 3715 65 4320');
    ok($np->is_fixed_line, '03715 65 4320 is a fixed line with a national prefix...');
    ok(!$np->is_mobile, '...it is not a mobile...');
    is($np->format, '+54 3715 65 4320', '...its international format is correct');
    is($np->format_using('National'), '03715 65-4320', '...as is its national format');
}
{
    my $np = Number::Phone::Lib->new('AR', '3715 15 65 4320');
    ok($np->is_mobile, '3715 15 65 4320 is a mobile with a national prefix...');
    ok(!$np->is_fixed_line, '...it is not a fixed line...');
    is($np->format, '+54 9 3715 65 4320', '...its international format is correct');
    is($np->format_using('National'), '03715 15-65-4320', '...as is its national format');
}
{
    my $np = Number::Phone::Lib->new('AR', '0 3715 15 65 4320');
    ok($np->is_mobile, '03715 15 65 4320 is a mobile with a national prefix...');
    ok(!$np->is_fixed_line, '...it is not a fixed line...');
    is($np->format, '+54 9 3715 65 4320', '...its international format is correct');
    is($np->format_using('National'), '03715 15-65-4320', '...as is its national format');
}