X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Ftest.pl;h=7550b490e5642f1818ac2bcdac574c73cf7d045b;hb=5c144d81801caa5e8317f6a38b40eb08257c47ea;hp=a35eb83693b4b7353786c8818dfcc4e6032a367d;hpb=135d199b8068090520a7a5e9a0462a9565e29293;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/test.pl b/t/test.pl index a35eb83..7550b49 100644 --- a/t/test.pl +++ b/t/test.pl @@ -101,8 +101,8 @@ sub _q { my $x = shift; return 'undef' unless defined $x; my $q = $x; - $q =~ s/\\/\\\\/; - $q =~ s/'/\\'/; + $q =~ s/\\/\\\\/g; + $q =~ s/'/\\'/g; return "'$q'"; } @@ -291,6 +291,18 @@ sub skip { last SKIP; } +sub todo_skip { + my $why = shift; + my $n = @_ ? shift : 1; + + for (1..$n) { + print STDOUT "ok $test # TODO & SKIP: $why\n"; + $test++; + } + local $^W = 0; + last TODO; +} + sub eq_array { my ($ra, $rb) = @_; return 0 unless $#$ra == $#$rb; @@ -412,6 +424,12 @@ sub _create_runperl { # Create the string to qx in runperl(). } } elsif (defined $args{progfile}) { $runperl .= qq( "$args{progfile}"); + } else { + # You probaby didn't want to be sucking in from the upstream stdin + die "test.pl:runperl(): none of prog, progs, progfile, args, " + . " switches or stdin specified" + unless defined $args{args} or defined $args{switches} + or defined $args{stdin}; } if (defined $args{stdin}) { # so we don't try to put literal newlines and crs onto the @@ -455,6 +473,8 @@ sub _create_runperl { # Create the string to qx in runperl(). } sub runperl { + die "test.pl:runperl() does not take a hashref" + if ref $_[0] and ref $_[0] eq 'HASH'; my $runperl = &_create_runperl; my $result = `$runperl`; $result =~ s/\n\n/\n/ if $is_vms; # XXX pipes sometimes double these