File: 01basic.t

package info (click to toggle)
libv-perl 0.22-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192 kB
  • sloc: perl: 556; makefile: 2
file content (38 lines) | stat: -rwxr-xr-x 758 bytes parent folder | download
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
34
35
36
37
38
#!/usr/bin/perl -I.

use strict;
use warnings;

use t::Test::abeltje;

require_ok ("V");

ok ($V::VERSION, '$V::VERSION is there');

SKIP: {
    local $ENV{PERL5OPT} = -d "blib" ? "-Mblib" : "-Mlib=lib";
    local *PIPE;
    my $out;
    if (open PIPE, qq!$^X -MV |!) {
	$out = do { local $/; <PIPE> };
	unless (close PIPE) {
	    if (open PIPE, qq!$^X -I. -e "use V;" |!) {
		$out = do { local $/; <PIPE> };
		skip "Error in pipe(2): $! [$?]", 1 unless close PIPE;
		}
	    else {
		skip "Could not fork: $!", 1;
		}
	    $out or skip "Error in pipe(1): $! [$?]", 1;
	    }
	}
    else {
	skip "Could not fork: $!";
	}

    my ($version) = $out =~ /^.+?([\d._]+)$/m;

    is ($version, $V::VERSION, "Version ok ($version)");
    }

abeltje_done_testing ();