X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Fauthor%2Funicode_plugin_nested_params.t;fp=t%2Fauthor%2Funicode_plugin_nested_params.t;h=b31f4ce909120ee14839e5e2b640959e97954188;hp=0000000000000000000000000000000000000000;hb=e05b48a6ba4eb1367c8886ce7b2d41c7caf21226;hpb=01733d0ff7d9b1b0677b86d7314d1e0e11ed67d5 diff --git a/t/author/unicode_plugin_nested_params.t b/t/author/unicode_plugin_nested_params.t new file mode 100644 index 0000000..b31f4ce --- /dev/null +++ b/t/author/unicode_plugin_nested_params.t @@ -0,0 +1,71 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Test::More; +use utf8; + +# setup library path +use FindBin qw($Bin); +use lib "$Bin/lib"; + +BEGIN { eval { require Catalyst::Plugin::Params::Nested; 1; } || + plan skip_all => 'Need Catalyst::Plugin::Params::Nested' } + +use Catalyst::Test 'TestApp2'; +use Encode; +use HTTP::Request::Common; +use URI::Escape qw/uri_escape_utf8/; +use HTTP::Status 'is_server_error'; + +my $encode_str = "\x{e3}\x{81}\x{82}"; # e38182 is japanese 'ã' +my $decode_str = Encode::decode('utf-8' => $encode_str); +my $escape_str = uri_escape_utf8($decode_str); + +BEGIN { + eval 'require Catalyst::Plugin::Params::Nested'; + plan skip_all => 'Catalyst::Plugin::Params::Nested is required' if $@; +} + +{ + my ($res, $c) = ctx_request("/?foo.1=bar&foo.2=$escape_str"); + is( $c->res->output, '