4 use lib "$FindBin::Bin/../lib";
10 my $base = 'http://127.0.0.1';
12 my $request = Catalyst::Request->new({
13 _log => Catalyst::Log->new,
14 base => URI->new($base),
15 uri => URI->new("$base/"),
18 my $context = TestApp->new({
23 my $uri_with_multibyte = URI->new($base);
24 $uri_with_multibyte->path('/');
25 $uri_with_multibyte->query_form(
29 # multibyte with utf8 bytes
30 is($context->uri_for('/', { name => '村瀬大輔' }), $uri_with_multibyte, 'uri_for with utf8 bytes query');
31 is($context->req->uri_with({ name => '村瀬大輔' }), $uri_with_multibyte, 'uri_with with utf8 bytes query');
33 # multibyte with utf8 string
34 is($context->uri_for('/', { name => "\x{6751}\x{702c}\x{5927}\x{8f14}" }), $uri_with_multibyte, 'uri_for with utf8 string query');
35 is($context->req->uri_with({ name => "\x{6751}\x{702c}\x{5927}\x{8f14}" }), $uri_with_multibyte, 'uri_with with utf8 string query');
37 # multibyte captures and args
38 my $action = $context->controller('Action::Chained')
39 ->action_for('roundtrip_urifor_end');
44 is($context->uri_for($action, ['hütte'], 'hütte', {
47 'http://127.0.0.1/chained/roundtrip_urifor/h%C3%BCtte/h%C3%BCtte?test=h%C3%BCtte',
48 'uri_for with utf8 captures and args');