fix up the unit_core_uri_for_multibytechar test; "use utf8" so that we actually test...
Jonathan Rockway [Tue, 12 Feb 2008 07:55:11 +0000 (07:55 +0000)]
t/unit_core_uri_for_multibytechar.t

index f29d6af..72e9813 100644 (file)
@@ -5,9 +5,10 @@ use FindBin;
 use File::Spec;
 use lib File::Spec->catfile($FindBin::Bin, 'lib');
 
-use Test::More;
+use utf8; # for literal below
+use Encode; # URI.pm is braindead wrt unicode-flagged characters
 
-plan tests => 5;
+use Test::More tests => 5;
 
 use_ok('TestApp');
 
@@ -26,10 +27,9 @@ my $context = TestApp->new({
 my $uri_with_multibyte = URI->new($base);
 $uri_with_multibyte->path('/');
 $uri_with_multibyte->query_form(
-    name => '村瀬大輔',
+    name => Encode::encode('utf8', '村瀬大輔'),
 );
 
-
 # multibyte with utf8 bytes
 is($context->uri_for('/', { name => '村瀬大輔' }), $uri_with_multibyte, 'uri_for with utf8 bytes query');
 is($context->req->uri_with({ name => '村瀬大輔' }), $uri_with_multibyte, 'uri_with with utf8 bytes query');