File: streamy.t

package info (click to toggle)
libhtml-mason-psgihandler-perl 0.53-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 168 kB
  • sloc: perl: 162; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 652 bytes parent folder | download | duplicates (3)
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
use strict;
use FindBin;
use Test::More;
use Plack::Test;

use HTML::Mason::PSGIHandler::Streamy;

my $h = HTML::Mason::PSGIHandler::Streamy->new(
    comp_root => $FindBin::Bin,
);

my $handler = sub { $h->handle_psgi(@_) };

test_psgi app => $handler, client => sub {
    my $cb = shift;
    my $res = $cb->(HTTP::Request->new(GET => "http://localhost/hello.mhtml?foo=bar"));
    is $res->code, 200, 'got 200 response';
    like $res->content, qr/Hello World Foo/;
    like $res->content, qr/foo,bar/;

    $res = $cb->(HTTP::Request->new(GET => "http://localhost/hello.mhtml?403=1"));
    is $res->code, 403, 'got 403 response';

};

done_testing;