0a569d60c883d277ef1abd9c33608b7aa6948f8c
[catagits/Catalyst-Runtime.git] / t / unit_core_uri_for_multibytechar.t
1 use strict;
2 use warnings;
3
4 use FindBin;
5 use File::Spec;
6 use lib File::Spec->catfile($FindBin::Bin, 'lib');
7
8 use Test::More;
9
10 plan tests => 3;
11
12 use_ok('TestApp');
13
14 my $base = 'http://127.0.0.1';
15
16 my $request = Catalyst::Request->new({
17     base => URI->new($base),
18 });
19
20 my $context = TestApp->new({
21     request => $request,
22 });
23
24
25 my $uri_with_multibyte = URI->new($base);
26 $uri_with_multibyte->path('/');
27 $uri_with_multibyte->query_form(
28     name => '村瀬大輔',
29 );
30
31
32 # multibyte with utf8 bytes
33 is($context->uri_for('/', { name => '村瀬大輔' }), $uri_with_multibyte, 'uri with utf8 bytes query');
34
35
36 # multibyte with utf8 string
37 is($context->uri_for('/', { name => "\x{6751}\x{702c}\x{5927}\x{8f14}" }), $uri_with_multibyte, 'uri with utf8 string query');