File: 10-basics.t

package info (click to toggle)
libdevel-findperl-perl 0.016-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 132 kB
  • sloc: perl: 123; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 615 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
#! perl

use strict;
use warnings;

use Test::More;

use Config;
use IPC::Open2 'open2';
use Devel::FindPerl 'find_perl_interpreter';

my $perl = find_perl_interpreter;

diag("$perl is not $Config{perlpath}, this may or may not be problematic") if lc $perl ne lc $Config{perlpath} and not $ENV{PERL_CORE};

my $pid = open2(my($in, $out), $perl, qw/-MConfig=myconfig -e print -e myconfig/) or die "Could not start perl at $perl";
binmode $in, ':crlf' if $^O eq 'MSWin32';
my $ret = do { local $/; <$in> };
waitpid $pid, 0;
is(lc $ret, lc Config->myconfig, 'Config of found perl equals current perl');

done_testing;