This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In ReTest.pl, provide is(), isnt(), like() and unlike(), equivalent to test.pl
[perl5.git] / t / run / script.t
CommitLineData
8d063cd8
LW
1#!./perl
2
b5fe401b
MS
3BEGIN {
4 chdir 't';
5 @INC = '../lib';
c59238f2 6 require './test.pl'; # for which_perl() etc
b5fe401b
MS
7}
8
c59238f2 9my $Perl = which_perl();
b5fe401b 10
2d90ac95
NC
11my $filename = tempfile();
12
8d063cd8
LW
13print "1..3\n";
14
b5fe401b 15$x = `$Perl -le "print 'ok';"`;
8d063cd8
LW
16
17if ($x eq "ok\n") {print "ok 1\n";} else {print "not ok 1\n";}
18
2d90ac95 19open(try,">$filename") || (die "Can't open temp file.");
8d063cd8 20print try 'print "ok\n";'; print try "\n";
d1e4d418 21close try or die "Could not close: $!";
8d063cd8 22
2d90ac95 23$x = `$Perl $filename`;
8d063cd8
LW
24
25if ($x eq "ok\n") {print "ok 2\n";} else {print "not ok 2\n";}
26
2d90ac95 27$x = `$Perl <$filename`;
8d063cd8
LW
28
29if ($x eq "ok\n") {print "ok 3\n";} else {print "not ok 3\n";}