From: John Napiorkowski Date: Mon, 25 Jul 2016 20:39:15 +0000 (-0500) Subject: test case for reported regression X-Git-Tag: 5.90112~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=a050c28ac1ca3424009799a5472886323b8250bf test case for reported regression --- diff --git a/Changes b/Changes index cae9c78..045ddff 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ # This file documents the revision history for Perl extension Catalyst. +5.90112 - 2016-07-25 + - Fixed regression introduced in last release that caused the code to crap out + if you set the encoding to 'undef'. + 5.90111 - 2016-07-20 - Improved documentation around some of the unicode changes; tests (melmothx++) diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 2d40ae8..7f9fe30 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -204,7 +204,7 @@ sub composed_stats_class { __PACKAGE__->_encode_check(Encode::FB_CROAK | Encode::LEAVE_SRC); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.90111'; +our $VERSION = '5.90112'; $VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases sub import { diff --git a/lib/Catalyst/Runtime.pm b/lib/Catalyst/Runtime.pm index 8283b87..75796db 100644 --- a/lib/Catalyst/Runtime.pm +++ b/lib/Catalyst/Runtime.pm @@ -7,7 +7,7 @@ BEGIN { require 5.008003; } # Remember to update this in Catalyst as well! -our $VERSION = '5.90111'; +our $VERSION = '5.90112'; $VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases =head1 NAME diff --git a/t/undef_encoding_regression.t b/t/undef_encoding_regression.t new file mode 100644 index 0000000..049ac71 --- /dev/null +++ b/t/undef_encoding_regression.t @@ -0,0 +1,42 @@ +use utf8; +use warnings; +use strict; +use Test::More; +use HTTP::Request::Common; +use HTTP::Message::PSGI (); +use Encode 2.21 'decode_utf8', 'encode_utf8', 'encode'; + +{ + package MyApp::Controller::Root; + $INC{'MyApp/Controller/Root.pm'} = __FILE__; + + use base 'Catalyst::Controller'; + + sub heart :Local Args(1) { + my ($self, $c, $arg) = @_; + + Test::More::is $c->req->query_parameters->{a}, 111; + Test::More::is $c->req->query_parameters->{b}, 222; + Test::More::is $arg, 1; + + $c->response->content_type('text/html'); + $c->response->body("

This is path local

"); + } + + package MyApp; + use Catalyst; + + MyApp->config(encoding => undef); + + Test::More::ok(MyApp->setup, 'setup app'); +} + +use Catalyst::Test 'MyApp'; + +{ + my $res = request "/root/heart/1?a=111&b=222"; + is $res->code, 200, 'OK'; + is $res->content, '

This is path local

'; +} + +done_testing;