[Jifty-commit] r2652 - in jifty/trunk: t t/TestApp/t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Jan 27 05:13:28 EST 2007


Author: jesse
Date: Sat Jan 27 05:13:27 2007
New Revision: 2652

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/t/10-i18n.t
   jifty/trunk/t/TestApp/t/i18n-standalone.t

Log:
 r21544 at hualien:  jesse | 2007-01-27 18:12:50 +0800
 * More i18n tests dealing with unknown strings


Modified: jifty/trunk/t/10-i18n.t
==============================================================================
--- jifty/trunk/t/10-i18n.t	(original)
+++ jifty/trunk/t/10-i18n.t	Sat Jan 27 05:13:27 2007
@@ -3,7 +3,7 @@
 use warnings;
 use strict;
 
-use Test::More tests => 1;
+use Test::More tests => 2;
 
 use DateTime;
 use Jifty::Everything;
@@ -14,7 +14,14 @@
 my $lh = Jifty::I18N->new();
 
 
+
 # the localization method used to break DateTime object stringification
 is($dt,_($dt));
 
+# Substitution needs to work, even in the default locale
+
+my $base = "I have %1 concrete mixers";
+
+is(_($base,2), "I have 2 concrete mixers");
+
 

Modified: jifty/trunk/t/TestApp/t/i18n-standalone.t
==============================================================================
--- jifty/trunk/t/TestApp/t/i18n-standalone.t	(original)
+++ jifty/trunk/t/TestApp/t/i18n-standalone.t	Sat Jan 27 05:13:27 2007
@@ -5,7 +5,7 @@
 use lib 't/lib';
 use Jifty::SubTest;
 
-use Jifty::Test tests => 12;
+use Jifty::Test tests => 16;
 use Jifty::Test::WWW::Mechanize;
 use Net::HTTP;
 use URI;
@@ -28,11 +28,19 @@
 ok $res->is_success, "can access admin console";
 like $res->content, qr/Models/, 'en works';
 
+$res = $ua->get("$base/concrete.html");
+ok $res->is_success, "can access concrete";
+like $res->content, qr/2 concrete mixers/, 'en works for an unknown string';
+
 $ua->default_header('Accept-Language' => "ja");
 $res = $ua->get("$base/__jifty/admin/");
 ok $res->is_success, "can access admin console";
 like adjust($res->content), qr/モデル/, 'ja works';
 
+$res = $ua->get("$base/concrete.html");
+ok $res->is_success, "can access concrete";
+like $res->content, qr/2 concrete mixers/, 'ja works for an unknown string';
+
 $ua->default_header('Accept-Language' => "fr");
 $res = $ua->get("$base/__jifty/admin/");
 ok $res->is_success, "can access admin console";


More information about the Jifty-commit mailing list