File: data1.t

package info (click to toggle)
libmodule-compile-perl 0.38-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 332 kB
  • sloc: perl: 1,831; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 667 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
28
29
30
31
32
my $t; use lib ($t = -e 't' ? 't' : 'test'), 'inc';
use TestModuleCompile tests => 4;
use Capture::Tiny qw(capture);
use App::Prove;

no_diff;

my $pmc;
BEGIN {
    $pmc = "$t/lib/DataTest.pmc";
    unlink($pmc);
    ok((not -e $pmc), ".pmc doesn't exist yet");
}

use DataTest;

ok((-e $pmc), ".pmc exists");

{
    local $/;
    my $data = <DataTest::DATA>;
    is $data, "\none\ntwo\n\nthree\n\n",
        "DATA section is correct";
}

my ($out, $err, $exit) = capture {
  my $app = App::Prove->new;
  $app->process_args(qw(-l), "$t/data2.t.subrun");
  $app->run ? 0 : 1;
};
is $exit, 0, '.pmc load works same'
  or diag 'Output was: ', $out, 'Error was: ', $err;