|
Revision 2562, 0.8 kB
(checked in by bchoate, 18 months ago)
|
|
Test suite cleanup. Use MT::Test to force t/ based configuration file for all tests. Fixed several tests that had incorrect expected values.
|
-
Property svn:keywords set to
Id
|
| Line | |
|---|
| 1 | #!/usr/bin/perl |
|---|
| 2 | # $Id$ |
|---|
| 3 | use strict; |
|---|
| 4 | use warnings; |
|---|
| 5 | |
|---|
| 6 | use lib 't/lib'; |
|---|
| 7 | use lib 'lib'; |
|---|
| 8 | use lib 'extlib'; |
|---|
| 9 | |
|---|
| 10 | use MT; |
|---|
| 11 | use MT::Test; |
|---|
| 12 | use MT::Util; |
|---|
| 13 | |
|---|
| 14 | my @tests = ( |
|---|
| 15 | { |
|---|
| 16 | text => 'Siegfried & Roy', |
|---|
| 17 | iso => 'siegfried_roy', |
|---|
| 18 | utf8 => 'siegfried_roy', |
|---|
| 19 | }, |
|---|
| 20 | { |
|---|
| 21 | text => 'Cauchy-Schwartz Inequality', |
|---|
| 22 | iso => 'cauchy-schwartz_inequality', |
|---|
| 23 | utf8 => 'cauchy-schwartz_inequality', |
|---|
| 24 | }, |
|---|
| 25 | { |
|---|
| 26 | text => "M\303\272m", |
|---|
| 27 | utf8 => 'mum', |
|---|
| 28 | }, |
|---|
| 29 | ); |
|---|
| 30 | |
|---|
| 31 | use Test::More tests => 5; |
|---|
| 32 | |
|---|
| 33 | MT->set_language('en_US'); |
|---|
| 34 | |
|---|
| 35 | for my $test (@tests) { |
|---|
| 36 | my ($text, $iso, $utf8) = @{ $test }{qw( text iso utf8 )}; |
|---|
| 37 | is(MT::Util::iso_dirify($text), $iso, "String '$text' iso_dirifies correctly") |
|---|
| 38 | if $iso; |
|---|
| 39 | is(MT::Util::utf8_dirify($text), $utf8, "String '$text' utf8_dirifies correctly") |
|---|
| 40 | if $utf8; |
|---|
| 41 | } |
|---|
| 42 | |
|---|