root/trunk/t/13-dirify.t

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$
3use strict;
4use warnings;
5
6use lib 't/lib';
7use lib 'lib';
8use lib 'extlib';
9
10use MT;
11use MT::Test;
12use MT::Util;
13
14my @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
31use Test::More tests => 5;
32
33MT->set_language('en_US');
34
35for 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
Note: See TracBrowser for help on using the browser.