[Catalyst-commits] r14293 - in
Catalyst-Plugin-Unicode-Encoding/trunk: . t t/lib
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Wed May 9 21:14:55 GMT 2012
Author: t0m
Date: 2012-05-09 21:14:55 +0000 (Wed, 09 May 2012)
New Revision: 14293
Added:
Catalyst-Plugin-Unicode-Encoding/trunk/t/08charset_utf8.t
Catalyst-Plugin-Unicode-Encoding/trunk/t/lib/TestLogger.pm
Modified:
Catalyst-Plugin-Unicode-Encoding/trunk/Changes
Log:
More fixed, with tests
Modified: Catalyst-Plugin-Unicode-Encoding/trunk/Changes
===================================================================
--- Catalyst-Plugin-Unicode-Encoding/trunk/Changes 2012-05-05 23:02:16 UTC (rev 14292)
+++ Catalyst-Plugin-Unicode-Encoding/trunk/Changes 2012-05-09 21:14:55 UTC (rev 14293)
@@ -1,5 +1,8 @@
Revision history for Perl extension Catalyst::Plugin::Unicode::Encoding
+ - Add proper tests for charset parsing issues.
+ - Fix all known charset parsing issues.
+
1.6 2012-05-05 14:18:00
- And another issue with the same regex. RT#75006
Added: Catalyst-Plugin-Unicode-Encoding/trunk/t/08charset_utf8.t
===================================================================
--- Catalyst-Plugin-Unicode-Encoding/trunk/t/08charset_utf8.t (rev 0)
+++ Catalyst-Plugin-Unicode-Encoding/trunk/t/08charset_utf8.t 2012-05-09 21:14:55 UTC (rev 14293)
@@ -0,0 +1,29 @@
+use strict;
+use warnings;
+use Test::More;
+use FindBin qw/ $Bin /;
+use lib "$Bin/lib";
+use TestLogger;
+
+BEGIN {
+ $ENV{TESTAPP_ENCODING} = 'UTF-8';
+ $ENV{TESTAPP_DEBUG} = 0;
+ $ENV{CATALYST_DEBUG} = 0;
+}
+
+use Catalyst::Test 'TestApp';
+TestApp->log(TestLogger->new);
+
+ok request('/capture_charset/utf-8');
+is scalar(@TestLogger::LOGS), 0;
+
+ok request('/capture_charset/latin1');
+is scalar(@TestLogger::LOGS), 1;
+
+ at TestLogger::LOGS = ();
+
+ok request('/capture_charset/iso-8859-1; header=present');
+is scalar(@TestLogger::LOGS), 1;
+like $TestLogger::LOGS[0], qr/content type is 'iso-8859-1'/;
+
+done_testing;
Added: Catalyst-Plugin-Unicode-Encoding/trunk/t/lib/TestLogger.pm
===================================================================
--- Catalyst-Plugin-Unicode-Encoding/trunk/t/lib/TestLogger.pm (rev 0)
+++ Catalyst-Plugin-Unicode-Encoding/trunk/t/lib/TestLogger.pm 2012-05-09 21:14:55 UTC (rev 14293)
@@ -0,0 +1,17 @@
+package TestLogger;
+use strict;
+use warnings;
+
+our @LOGS;
+
+sub new {
+ return bless {}, __PACKAGE__;
+}
+
+sub debug {
+ shift;
+ push(@LOGS, shift());
+}
+
+1;
+
More information about the Catalyst-commits
mailing list