Skip to content

Commit d819137

Browse files
author
Chris White
committed
Tests 05 and 06 run, as do some of 07
1 parent 6873968 commit d819137

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

t/05-external-command.t

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/usr/bin/env perl
22
# Tests of perlpp <?!...?> external commands
3+
#
4+
# TODO: On non-Unix, test only `echo` with no parameters.
5+
36
use rlib './lib';
47
use PerlPPTest;
5-
use constant CMD => ($ENV{PERLPP_CMD} || 'perl -Iblib/lib blib/script/perlpp');
68

79
(my $whereami = __FILE__) =~ s/macro\.t$//;
810
my $incfn = '\"' . $whereami . 'included.txt\"';
@@ -26,8 +28,8 @@ for my $lrTest (@testcases) {
2628
my ($opts, $testin, $out_re, $err_re) = @$lrTest;
2729

2830
my ($out, $err);
29-
print STDERR CMD . " $opts", " <<<'", $testin, "'\n";
30-
run3 CMD . " $opts", \$testin, \$out, \$err;
31+
diag "perlpp $opts <<<@{[Text::PerlPP::_QuoteString $testin]}";
32+
run_perlpp $opts, \$testin, \$out, \$err;
3133

3234
if(defined $out_re) {
3335
like($out, $out_re);

t/06-macro.t

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ my @testcases=(
1414
# $err_re (stderr output, if any)]
1515

1616
# %Defs
17-
['-D foo=42', '<?:macro say $Text::PerlPP::Defs{foo}; ?>', qr/^42/],
18-
['-D incfile=' . $incfn , '<?:macro Include $Text::PerlPP::Defs{incfile}; ?>',
17+
['-D foo=42', '<?:macro say $PSelf->{Defs}->{foo}; ?>', qr/^42/],
18+
['-D incfile=' . $incfn , '<?:macro $PSelf->Include( $PSelf->{Defs}->{incfile} ); ?>',
1919
qr/^a4b/],
20-
['-s incfile=' . $incfn , '<?:macro Include $Text::PerlPP::Sets{incfile}; ?>',
20+
['-s incfile=' . $incfn , '<?:macro $PSelf->Include( $PSelf->{Sets}->{incfile} ); ?>',
2121
qr/^a4b/],
2222
['', '<?:immediate say "print 128;"; ?>',qr/^128$/],
2323

@@ -29,8 +29,8 @@ for my $lrTest (@testcases) {
2929
my ($opts, $testin, $out_re, $err_re) = @$lrTest;
3030

3131
my ($out, $err);
32-
print STDERR CMD . " $opts", " <<<'", $testin, "'\n";
33-
run3 CMD . " $opts", \$testin, \$out, \$err;
32+
diag "perlpp $opts", " <<<'", $testin, "'\n";
33+
run_perlpp $opts, \$testin, \$out, \$err;
3434

3535
if(defined $out_re) {
3636
like($out, $out_re);

t/07-invalid.t

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ for my $lrTest (@testcases) {
4444
# by default, accept any stderr output as indicative of a failure
4545
# (a successful test case).
4646

47-
run3 CMD, \$testin, \$out, \$err;
47+
run_perlpp [], \$testin, \$out, \$err;
4848
like($err, $err_re);
4949

5050
} # foreach test
5151

5252
for my $lrTest (@testcases2) {
5353
my $err_re = shift @$lrTest;
54-
run3 join(' ', CMD, @$lrTest), \undef, \undef, \$err;
54+
diag join(' ',@$lrTest);
55+
run_perlpp $lrTest, undef, undef, \$err;
5556
like($err, $err_re);
5657
}
5758

0 commit comments

Comments
 (0)