summaryrefslogtreecommitdiff
path: root/t/run/script.t
blob: fa61a2ce33b55dabf3e9090eb6c2745ca690258e (plain)
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
#!./perl

BEGIN {
    chdir 't' if -d 't';
    @INC = '../lib';
    require './test.pl';	# for which_perl() etc
    plan(3);
}

my $Perl = which_perl();

my $filename = tempfile();

$x = `$Perl -le "print 'ok';"`;

is($x, "ok\n", "Got expected 'perl -le' output");

open(try,">$filename") || (die "Can't open temp file.");
print try 'print "ok\n";'; print try "\n";
close try or die "Could not close: $!";

$x = `$Perl $filename`;

is($x, "ok\n", "Got expected output of command from script");

$x = `$Perl <$filename`;

is($x, "ok\n", "Got expected output of command read from script");