add a test for the uri_for utf8 stuff
Rafael Kitover [Thu, 7 Jan 2010 00:04:45 +0000 (00:04 +0000)]
t/aggregate/unit_core_uri_for_multibytechar.t

index 3320491..6f5d8ae 100644 (file)
@@ -1,10 +1,9 @@
 use strict;
 use warnings;
-
 use FindBin;
 use lib "$FindBin::Bin/../lib";
 
-use Test::More tests => 5;
+use Test::More;
 
 use_ok('TestApp');
 
@@ -33,3 +32,19 @@ is($context->req->uri_with({ name => '村瀬大輔' }), $uri_with_multibyte, 'ur
 # multibyte with utf8 string
 is($context->uri_for('/', { name => "\x{6751}\x{702c}\x{5927}\x{8f14}" }), $uri_with_multibyte, 'uri_for with utf8 string query');
 is($context->req->uri_with({ name => "\x{6751}\x{702c}\x{5927}\x{8f14}" }), $uri_with_multibyte, 'uri_with with utf8 string query');
+
+# multibyte captures and args
+my $action = $context->controller('Action::Chained')
+    ->action_for('roundtrip_urifor_end');
+
+{
+use utf8;
+
+is($context->uri_for($action, ['hütte'], 'hütte', {
+    test => 'hütte'
+}),
+'http://127.0.0.1/chained/roundtrip_urifor/h%C3%BCtte/h%C3%BCtte?test=h%C3%BCtte',
+'uri_for with utf8 captures and args');
+}
+
+done_testing;