X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Ftest.pl;h=830223677b74f9348af4e3fc9e256fa3cef8691a;hb=3fd969f44926f311e1c67d9470a9e936f7af2d73;hp=32c4a374e5dfeaca47821909207f4c5b2e5f6b40;hpb=afe79e7bf0741363f2de40dc6f4c1284c1e35a5a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/test.pl b/t/test.pl index 32c4a37..8302236 100644 --- a/t/test.pl +++ b/t/test.pl @@ -183,8 +183,8 @@ sub is ($$@) { } unless ($pass) { - unshift(@mess, "# got "._q($got)."\n", - "# expected "._q($expected)."\n"); + unshift(@mess, "# got "._qq($got)."\n", + "# expected "._qq($expected)."\n"); } _ok($pass, _where(), $name, @mess); } @@ -202,7 +202,7 @@ sub isnt ($$@) { } unless( $pass ) { - unshift(@mess, "# it should not be "._q($got)."\n", + unshift(@mess, "# it should not be "._qq($got)."\n", "# but it is.\n"); } _ok($pass, _where(), $name, @mess); @@ -229,8 +229,8 @@ sub cmp_ok ($$$@) { if ($got eq $expected and $type !~ tr/a-z//) { unshift @mess, "# $got - $expected = " . ($got - $expected) . "\n"; } - unshift(@mess, "# got "._q($got)."\n", - "# expected $type "._q($expected)."\n"); + unshift(@mess, "# got "._qq($got)."\n", + "# expected $type "._qq($expected)."\n"); } _ok($pass, _where(), $name, @mess); } @@ -266,8 +266,8 @@ sub within ($$$@) { if ($got eq $expected) { unshift @mess, "# $got - $expected = " . ($got - $expected) . "\n"; } - unshift@mess, "# got "._q($got)."\n", - "# expected "._q($expected)." (within "._q($range).")\n"; + unshift@mess, "# got "._qq($got)."\n", + "# expected "._qq($expected)." (within "._qq($range).")\n"; } _ok($pass, _where(), $name, @mess); } @@ -405,7 +405,6 @@ USE_OK my $is_mswin = $^O eq 'MSWin32'; my $is_netware = $^O eq 'NetWare'; -my $is_macos = $^O eq 'MacOS'; my $is_vms = $^O eq 'VMS'; my $is_cygwin = $^O eq 'cygwin'; @@ -431,14 +430,7 @@ sub _create_runperl { # Create the string to qx in runperl(). $runperl = "$ENV{PERL_RUNPERL_DEBUG} $runperl"; } unless ($args{nolib}) { - if ($is_macos) { - $runperl .= ' -I::lib'; - # Use UNIX style error messages instead of MPW style. - $runperl .= ' -MMac::err=unix' if $args{stderr}; - } - else { - $runperl .= ' "-I../lib"'; # doublequotes because of VMS - } + $runperl .= ' "-I../lib"'; # doublequotes because of VMS } if ($args{switches}) { local $Level = 2; @@ -481,19 +473,6 @@ sub _create_runperl { # Create the string to qx in runperl(). $runperl = qq{$Perl -e "print qq(} . $args{stdin} . q{)" | } . $runperl; } - elsif ($is_macos) { - # MacOS can only do two processes under MPW at once; - # the test itself is one; we can't do two more, so - # write to temp file - my $stdin = qq{$Perl -e 'print qq(} . $args{stdin} . qq{)' > teststdin; }; - if ($args{verbose}) { - my $stdindisplay = $stdin; - $stdindisplay =~ s/\n/\n\#/g; - _print_stderr "# $stdindisplay\n"; - } - `$stdin`; - $runperl .= q{ < teststdin }; - } else { $runperl = qq{$Perl -e 'print qq(} . $args{stdin} . q{)' | } . $runperl; @@ -502,8 +481,7 @@ sub _create_runperl { # Create the string to qx in runperl(). if (defined $args{args}) { _quote_args(\$runperl, $args{args}); } - $runperl .= ' 2>&1' if $args{stderr} && !$is_macos; - $runperl .= " \xB3 Dev:Null" if !$args{stderr} && $is_macos; + $runperl .= ' 2>&1' if $args{stderr}; if ($args{verbose}) { my $runperldisplay = $runperl; $runperldisplay =~ s/\n/\n\#/g; @@ -681,7 +659,7 @@ sub _fresh_perl { my $status = $?; # Clean up the results into something a bit more predictable. - $results =~ s/\n+$//; + $results =~ s/\n+$//; $results =~ s/at\s+$::tempfile_regexp\s+line/at - line/g; $results =~ s/of\s+$::tempfile_regexp\s+aborted/of - aborted/g; @@ -722,6 +700,11 @@ sub _fresh_perl { sub fresh_perl_is { my($prog, $expected, $runperl_args, $name) = @_; + + # _fresh_perl() is going to clip the trailing newlines off the result. + # This will make it so the test author doesn't have to know that. + $expected =~ s/\n+$//; + local $Level = 2; _fresh_perl($prog, sub { @_ ? $_[0] eq $expected : $expected },