Commit | Line | Data |
---|---|---|
8d063cd8 | 1 | #!./perl |
2 | ||
b5fe401b | 3 | BEGIN { |
4 | chdir 't'; | |
5 | @INC = '../lib'; | |
c59238f2 | 6 | require './test.pl'; # for which_perl() etc |
b5fe401b | 7 | } |
8 | ||
c59238f2 | 9 | my $Perl = which_perl(); |
b5fe401b | 10 | |
2d90ac95 | 11 | my $filename = tempfile(); |
12 | ||
8d063cd8 | 13 | print "1..3\n"; |
14 | ||
b5fe401b | 15 | $x = `$Perl -le "print 'ok';"`; |
8d063cd8 | 16 | |
17 | if ($x eq "ok\n") {print "ok 1\n";} else {print "not ok 1\n";} | |
18 | ||
2d90ac95 | 19 | open(try,">$filename") || (die "Can't open temp file."); |
8d063cd8 | 20 | print try 'print "ok\n";'; print try "\n"; |
d1e4d418 | 21 | close try or die "Could not close: $!"; |
8d063cd8 | 22 | |
2d90ac95 | 23 | $x = `$Perl $filename`; |
8d063cd8 | 24 | |
25 | if ($x eq "ok\n") {print "ok 2\n";} else {print "not ok 2\n";} | |
26 | ||
2d90ac95 | 27 | $x = `$Perl <$filename`; |
8d063cd8 | 28 | |
29 | if ($x eq "ok\n") {print "ok 3\n";} else {print "not ok 3\n";} |