[Catalyst-commits] r14071 - in
Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand: . t t/lib
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Mon Aug 8 08:42:17 GMT 2011
Author: t0m
Date: 2011-08-08 08:42:17 +0000 (Mon, 08 Aug 2011)
New Revision: 14071
Added:
Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/07live_parse_on_demand.t
Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/08invalid.t
Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/08request_decode_parse_on_demand.t
Modified:
Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/Makefile.PL
Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/04live.t
Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/06request_decode.t
Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/lib/TestApp.pm
Log:
Failing tests
Modified: Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/Makefile.PL
===================================================================
--- Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/Makefile.PL 2011-08-08 08:41:52 UTC (rev 14070)
+++ Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/Makefile.PL 2011-08-08 08:42:17 UTC (rev 14071)
@@ -1,3 +1,14 @@
+BEGIN {
+ if (
+ eval { require Encode; Encode->VERSION('2.40'); 1 }
+ && eval { require LWP; 1 }
+ && !eval { LWP->VERSION('5.837'); 1 }
+ ) {
+ warn 'Encode >= 2.40 (which you have installed) fixed a bug which breaks LWP - please upgrade LWP to >= 5.837 or encoding is not going to work well for you! https://rt.cpan.org/Ticket/Display.html?id=61456\n';
+ exit 0;
+ }
+}
+
use inc::Module::Install 0.91;
use Module::Install::AuthorRequires;
use Module::Install::AuthorTests;
Modified: Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/04live.t
===================================================================
--- Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/04live.t 2011-08-08 08:41:52 UTC (rev 14070)
+++ Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/04live.t 2011-08-08 08:42:17 UTC (rev 14071)
@@ -10,11 +10,13 @@
use lib "$Bin/lib";
BEGIN {
-if ( !eval { require Test::WWW::Mechanize::Catalyst } || ! Test::WWW::Mechanize::Catalyst->VERSION('0.51') ) {
- plan skip_all => 'Need Test::WWW::Mechanize::Catalyst for this test';
+ if ( !eval { require Test::WWW::Mechanize::Catalyst; Test::WWW::Mechanize::Catalyst->VERSION('0.51'); 1} ) {
+ plan skip_all => 'Need Test::WWW::Mechanize::Catalyst for this test';
+ }
}
-}
+
+
# make sure testapp works
use_ok('TestApp') or BAIL_OUT($@);
Modified: Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/06request_decode.t
===================================================================
--- Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/06request_decode.t 2011-08-08 08:41:52 UTC (rev 14070)
+++ Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/06request_decode.t 2011-08-08 08:42:17 UTC (rev 14071)
@@ -19,7 +19,9 @@
my $escape_str = uri_escape_utf8($decode_str);
check_parameter(GET "/?foo=$escape_str");
+diag 'bar';
check_parameter(POST '/', ['foo' => $encode_str]);
+diag 'quux';
check_parameter(POST '/',
Content_Type => 'form-data',
Content => [
@@ -31,6 +33,7 @@
);
check_argument(GET "/$escape_str");
+diag 'foo';
check_capture(GET "/capture/$escape_str");
sub check_parameter {
Added: Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/07live_parse_on_demand.t
===================================================================
--- Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/07live_parse_on_demand.t (rev 0)
+++ Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/07live_parse_on_demand.t 2011-08-08 08:42:17 UTC (rev 14071)
@@ -0,0 +1,7 @@
+use strict;
+use warnings;
+use FindBin qw/ $Bin /;
+
+$ENV{TESTAPP_PARSE_ON_DEMAND} = 1;
+
+require "$Bin/04live.t";
Added: Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/08invalid.t
===================================================================
--- Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/08invalid.t (rev 0)
+++ Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/08invalid.t 2011-08-08 08:42:17 UTC (rev 14071)
@@ -0,0 +1,26 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use Test::More tests => 1;
+use utf8;
+
+# setup library path
+use FindBin qw($Bin);
+use lib "$Bin/lib";
+
+use Catalyst::Test 'TestApp';
+use HTML::Entities;
+use HTTP::Request::Common;
+
+my $invalid = decode_entities('å');
+warn $invalid;
+my ( undef, $c ) = ctx_request(HEAD '/'.$invalid);
+if (! defined($c) || $c->res->status == 500)
+{
+ fail('Should gracefully handle invalid UTF8');
+}
+else
+{
+ ok(1,'Should gracefully handle invalid UTF8');
+}
Added: Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/08request_decode_parse_on_demand.t
===================================================================
--- Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/08request_decode_parse_on_demand.t (rev 0)
+++ Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/08request_decode_parse_on_demand.t 2011-08-08 08:42:17 UTC (rev 14071)
@@ -0,0 +1,7 @@
+use strict;
+use warnings;
+use FindBin qw/ $Bin /;
+
+$ENV{TESTAPP_PARSE_ON_DEMAND} = 1;
+
+require "$Bin/06request_decode.t";
Modified: Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/lib/TestApp.pm
===================================================================
--- Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/lib/TestApp.pm 2011-08-08 08:41:52 UTC (rev 14070)
+++ Catalyst-Plugin-Unicode-Encoding/branches/parse_on_demand/t/lib/TestApp.pm 2011-08-08 08:42:17 UTC (rev 14071)
@@ -8,6 +8,10 @@
encoding => $ENV{TESTAPP_ENCODING}
) if $ENV{TESTAPP_ENCODING};
+__PACKAGE__->config(
+ parse_on_demand => $ENV{TESTAPP_PARSE_ON_DEMAND}
+) if $ENV{TESTAPP_PARSE_ON_DEMAND};
+
__PACKAGE__->config('name' => 'TestApp');
__PACKAGE__->setup;
More information about the Catalyst-commits
mailing list