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
|
use warnings;
use strict;
use Encode;
use Plack::Test;
use Plack::Middleware::Debug;
use HTTP::Request::Common;
use Test::More;
my $app = sub {
my $env = shift;
$env->{'test.string'} = "\x{30c6}";
return [
200, [ 'Content-Type' => 'text/html' ],
[ encode_utf8("<body><h1>\x{30c6}\x{30b9}\x{30c8}</h1></body>") ]
];
};
$app = Plack::Middleware::Debug->wrap($app);
test_psgi $app, sub {
my $cb = shift;
my $res = $cb->(GET '/');
is $res->code, 200, 'response status 200';
like $res->content, qr!<h1>ใในใ</h1>!;
like $res->content, qr!<td>test.string</td>\s*<td><pre>テ</pre></td>!s;
};
done_testing;
|