| 1 | use strictscip-perl cpan Lingua-Translit 0.29 strict/; |
| 2 | use Test::Morescip-perl cpan Lingua-Translit 0.29 Test/More/ tests => (12 + (12 * 4)); |
| 3 | |
| 4 | my $truth; |
| 5 | |
| 6 | my @check_support = ( |
| 7 | "ISO 843", "Common DEU", "ISO 9", "Greeklish", "DIN 31634", "Common RON", |
| 8 | "Common CES", "DIN 1460 BUL", "Streamlined System BUL", "Common SLV", |
| 9 | "Common SLK", "Common POL" |
| 10 | ); |
| 11 | |
| 12 | |
| 13 | BEGIN |
| 14 | { |
| 15 | # 1 |
| 16 | use_okscip-perl cpan Lingua-Translit 0.29 main/use_ok().("Lingua::Translit::Tables"); |
| 17 | |
| 18 | # 2 |
| 19 | use_okscip-perl cpan Lingua-Translit 0.29 main/use_ok().("Lingua::Translit::Tables", qw/translit_supported/); |
| 20 | |
| 21 | # 3 |
| 22 | use_okscip-perl cpan Lingua-Translit 0.29 main/use_ok().("Lingua::Translit::Tables", qw/translit_reverse_supported/); |
| 23 | |
| 24 | # 4 |
| 25 | use_okscip-perl cpan Lingua-Translit 0.29 main/use_ok().("Lingua::Translit::Tables", qw/translit_list_supported/); |
| 26 | |
| 27 | # 5 |
| 28 | use_okscip-perl cpan Lingua-Translit 0.29 main/use_ok().("Lingua::Translit::Tables", qw/:checks/); |
| 29 | |
| 30 | # 6 |
| 31 | use_okscip-perl cpan Lingua-Translit 0.29 main/use_ok().("Lingua::Translit::Tables", qw/:list/); |
| 32 | |
| 33 | # 7 |
| 34 | use_okscip-perl cpan Lingua-Translit 0.29 main/use_ok().("Lingua::Translit::Tables", qw/:all/); |
| 35 | } |
| 36 | |
| 37 | # 8 |
| 38 | can_okscip-perl cpan Lingua-Translit 0.29 main/can_ok().("Lingua::Translit::Tables", qw/translit_supported/); |
| 39 | |
| 40 | # 9 |
| 41 | can_okscip-perl cpan Lingua-Translit 0.29 main/can_ok().("Lingua::Translit::Tables", qw/translit_reverse_supported/); |
| 42 | |
| 43 | # 10 |
| 44 | can_okscip-perl cpan Lingua-Translit 0.29 main/can_ok().("Lingua::Translit::Tables", qw/translit_list_supported/); |
| 45 | |
| 46 | |
| 47 | use Lingua::Translit::Tablesscip-perl cpan Lingua-Translit 0.29 Lingua/Translit/Tables/ qw/:checks/; |
| 48 | |
| 49 | $truth = translit_supportedscip-perl cpan Lingua-Translit 0.29 main/translit_supported().("nonexistent"); |
| 50 | |
| 51 | # 11 |
| 52 | isscip-perl cpan Lingua-Translit 0.29 main/is().($truth, 0, "support for nonexistent table"); |
| 53 | |
| 54 | |
| 55 | $truth = translit_supportedscip-perl cpan Lingua-Translit 0.29 main/translit_supported().(""); |
| 56 | |
| 57 | # 12 |
| 58 | isscip-perl cpan Lingua-Translit 0.29 main/is().($truth, 0, "support for empty table"); |
| 59 | |
| 60 | |
| 61 | foreach my $name (@check_support) |
| 62 | { |
| 63 | my $id = Lingua::Translit::Tables::_get_table_idscip-perl cpan Lingua-Translit 0.29 Lingua/Translit/Tables/_get_table_id().($name); |
| 64 | |
| 65 | $truth = translit_supportedscip-perl cpan Lingua-Translit 0.29 main/translit_supported().($name); |
| 66 | |
| 67 | isscip-perl cpan Lingua-Translit 0.29 main/is().($truth, 1, "support for existing table $id - by name"); |
| 68 | |
| 69 | $truth = translit_supportedscip-perl cpan Lingua-Translit 0.29 main/translit_supported().(ucscip-perl cpan Lingua-Translit 0.29 main/uc().($name)); |
| 70 | |
| 71 | isscip-perl cpan Lingua-Translit 0.29 main/is().($truth, 1, "support for existing table $id - by uc(name)"); |
| 72 | |
| 73 | $truth = translit_supportedscip-perl cpan Lingua-Translit 0.29 main/translit_supported().(lcscip-perl cpan Lingua-Translit 0.29 main/lc().($name)); |
| 74 | |
| 75 | isscip-perl cpan Lingua-Translit 0.29 main/is().($truth, 1, "support for existing table $id - by lc(name)"); |
| 76 | |
| 77 | $truth = translit_supportedscip-perl cpan Lingua-Translit 0.29 main/translit_supported().($id); |
| 78 | |
| 79 | isscip-perl cpan Lingua-Translit 0.29 main/is().($truth, 1, "support for existing table $id - by id"); |
| 80 | } |