File: TestMLBridge.pm

package info (click to toggle)
libinline-perl 0.86-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 504 kB
  • sloc: perl: 3,147; sh: 57; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 546 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
27
28
29
30
31
32
33
use strict; use warnings;
package TestMLBridge;
use base 'TestML::Bridge';

use Inline;
use File::Spec::Functions qw(abs2rel catdir);

sub derive_minus_i {
    my ($self, $perl, $paths) = @_;

    mkdir 'doc';
    mkdir 'eg';

    local @INC = @INC;
    eval $perl;

    my @got = map abs2rel($_), Inline->derive_minus_I;

    my $out = '';
    for my $path (split /\n/, $paths) {
        $out .= "$path\n" if grep { $path eq $_ } @got;
    }

    return $out;
}

sub eval_catch {
    my ($self, $perl) = @_;
    eval $perl;
    return $@;
}

1;