File: 90-rt129312.t

package info (click to toggle)
libpar-packer-perl 1.064-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,388 kB
  • sloc: perl: 12,774; ansic: 1,474; makefile: 30; sh: 5
file content (25 lines) | stat: -rw-r--r-- 672 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
#!/usr/bin/perl

use strict;
use warnings;

use Test::More;
require "./t/utils.pl";

# Archive::Unzip::Burst can't handle the archive constructed below
plan skip_all => "Archive::Unzip::Burst detected" if eval { require Archive::Unzip::Burst; 1; };

plan tests => 4;

my $hello = "hello, garbage\n";
my $exe = pp_ok(-e => "print qq[$hello]");
my $exe_size = -s $exe;

open my $fh, ">>:raw", $exe or die "can't append to $exe: $!";
my $garbage = "garbage\n" x 128;
print $fh $garbage for 1..512;
close $fh;

is(-s $exe, $exe_size + length($garbage) * 512, "executable has 512 kB garbage appended");
my ($out, $err) = run_ok($exe);
is($out, $hello) or diag("stderr: $err");