File: source.t

package info (click to toggle)
libcgi-compile-perl 0.27-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 248 kB
  • sloc: perl: 372; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 364 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env perl

use strict;
use warnings;
use Test::More;
use CGI::Compile;
use Capture::Tiny 'capture_stdout';

my $cgi =<<'EOL';
#!/usr/bin/perl

print "Content-Type: text/plain\015\012\015\012", <DATA>;

__DATA__
Hello
World
EOL

my $sub = CGI::Compile->compile(\$cgi);

my $out = capture_stdout { $sub->() };

like $out, qr/Hello\nWorld/;

done_testing;