whitespace cleanup
[catagits/Catalyst-Runtime.git] / t / not_utf8_query_bug.t
1 use utf8;
2 use warnings;
3 use strict;
4
5 # For reported: https://rt.cpan.org/Ticket/Display.html?id=103063
6
7 {
8   package MyApp::Controller::Root;
9   $INC{'MyApp/Controller/Root.pm'} = __FILE__;
10
11   use base 'Catalyst::Controller';
12
13   sub example :Local Args(0) {
14     pop->stash->{testing1} = 'testing2';
15   }
16
17   package MyApp;
18   use Catalyst;
19
20   #MyApp->config(decode_query_using_global_encoding=>1, encoding => 'SHIFT_JIS');
21   #MyApp->config(do_not_decode_query=>1);
22   #MyApp->config(decode_query_using_global_encoding=>1, encoding => undef);
23   MyApp->config(default_query_encoding=>'SHIFT_JIS');
24
25   MyApp->setup;
26 }
27
28 use Test::More;
29 use Catalyst::Test 'MyApp';
30 use Encode;
31 use HTTP::Request::Common;
32
33 {
34   my $shiftjs = 'test ใƒ†ใ‚นใƒˆ';
35   my $encoded = Encode::encode('SHIFT_JIS', $shiftjs);
36
37   ok my $req = GET "/root/example?a=$encoded";
38   my ($res, $c) = ctx_request $req;
39
40   is $c->req->query_parameters->{'a'}, $shiftjs, 'got expected value';
41 }
42
43
44 done_testing;
45