File: utf8_content_length.t

package info (click to toggle)
libcatalyst-perl 5.90124-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,992 kB
  • sloc: perl: 11,123; makefile: 7
file content (31 lines) | stat: -rw-r--r-- 713 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
use strict;
use warnings;
use FindBin qw/$Bin/;
use lib "$Bin/../lib";
use File::Spec;
use Test::More;

BEGIN { delete $ENV{CATALYST_HOME} }

use Catalyst::Test qw/TestAppEncoding/;

if ( $ENV{CATALYST_SERVER} ) {
    plan skip_all => 'This test does not run live';
    exit 0;
}

my $fn = "$Bin/../catalyst_130pix.gif";
ok -r $fn, 'Can read catalyst_130pix.gif';
my $size = -s $fn;
{
    my $r = request('/binary');
    is $r->code, 200, '/binary OK';
    is $r->header('Content-Length'), $size, '/binary correct content length';
}
{
    my $r = request('/binary_utf8');
    is $r->code, 200, '/binary_utf8 OK';
    is $r->header('Content-Length'), $size, '/binary_utf8 correct content length';
}

done_testing;