root/branches/release-36/t/13-dirify.t @ 2106

Revision 2106, 0.8 kB (checked in by mpaschal, 19 months ago)

Don't need to define tests in BEGIN if we're not calculating test count from it

  • 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::Util;
12
13my @tests = (
14    {
15        text => 'Siegfried & Roy',
16        iso  => 'siegfried_roy',
17        utf8 => 'siegfried_roy',
18    },
19    {
20        text => 'Cauchy-Schwartz Inequality',
21        iso  => 'cauchy-schwartz_inequality',
22        utf8 => 'cauchy-schwartz_inequality',
23    },
24    {
25        text => "M\303\272m",
26        utf8 => 'mum',
27    },
28);
29
30use Test::More tests => 5;
31
32MT->set_language('en_US');
33
34for my $test (@tests) {
35    my ($text, $iso, $utf8) = @{ $test }{qw( text iso utf8 )};
36    is(MT::Util::iso_dirify($text), $iso, "String '$text' iso_dirifies correctly")
37        if $iso;
38    is(MT::Util::utf8_dirify($text), $utf8, "String '$text' utf8_dirifies correctly")
39        if $utf8;
40}
41
Note: See TracBrowser for help on using the browser.