File: unicode_plugin_charset_utf8.t

package info (click to toggle)
libcatalyst-perl 5.90132-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,016 kB
  • sloc: perl: 11,061; makefile: 7
file content (32 lines) | stat: -rw-r--r-- 769 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use strict;
use warnings;
use Test::More;
use FindBin qw/ $Bin /;
use lib "$Bin/lib";
use Data::Dumper;

BEGIN {
  # $ENV{TESTAPP_ENCODING} = 'UTF-8'; # This is now default
    $ENV{TESTAPP_DEBUG} = 0;
    $ENV{CATALYST_DEBUG} = 0;
}

use Catalyst::Test 'TestAppUnicode';

ok request('/capture_charset/utf-8');
is scalar(@TestLogger::LOGS), 0;

ok request('/capture_charset/latin1');
is scalar(@TestLogger::LOGS), 1
    or diag Dumper(\@TestLogger::LOGS);

@TestLogger::LOGS = ();

ok request('/capture_charset/iso-8859-1; header=present');
is scalar(@TestLogger::LOGS), 1
    or diag Dumper(\@TestLogger::LOGS);
like $TestLogger::LOGS[0], qr/content type is 'iso-8859-1'/;

#like $TestLogger::ELOGS[0], qr/Unicode::Encoding plugin/; #no longer a plugin

done_testing;