summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/B/t/f_sort.t17
-rwxr-xr-xt/TEST3
2 files changed, 14 insertions, 6 deletions
diff --git a/ext/B/t/f_sort.t b/ext/B/t/f_sort.t
index 5a0c55be9b..f03b8cdc3e 100644
--- a/ext/B/t/f_sort.t
+++ b/ext/B/t/f_sort.t
@@ -9,12 +9,19 @@ use OptreeCheck;
plan tests => 20;
-=for gentest
+=head1 Test Notes
# chunk: #!perl
#examples poached from perldoc -f sort
-=cut
+NOTE: name is no longer a required arg for checkOptree, as label is
+synthesized out of others. HOWEVER, if the test-code has newlines in
+it, the label must be overridden by an explicit name.
+
+This is because t/TEST is quite particular about the test output it
+processes, and multi-line labels violate its 1-line-per-test
+expectations.
+
=for gentest
# chunk: # sort lexically
@@ -333,7 +340,7 @@ print sort @george, 'to', @harry;
=cut
-checkOptree(note => q{},
+checkOptree(name => q{sort USERSUB LIST },
bcopts => q{-exec},
todo => 'sort why BARE flag happens',
code => q{sub backwards { $b cmp $a }
@@ -463,7 +470,7 @@ sort { $b->[1] <=> $a->[1]
=cut
-checkOptree(note => q{},
+checkOptree(name => q{Compound sort/map Expression },
bcopts => q{-exec},
code => q{ @new = map { $_->[0] }
sort { $b->[1] <=> $a->[1] || $a->[2] cmp $b->[2] }
@@ -554,7 +561,7 @@ package main;
=cut
-checkOptree(note => q{},
+checkOptree(name => q{sort other::sub LIST },
bcopts => q{-exec},
code => q{package other; sub backwards ($$) { $_[1] cmp $_[0]; }
package main; @new = sort other::backwards @old; },
diff --git a/t/TEST b/t/TEST
index 5d5727ad05..7210d2f396 100755
--- a/t/TEST
+++ b/t/TEST
@@ -447,7 +447,8 @@ EOT
}
else {
$next += 1;
- print "${te}FAILED at test $next\n";
+ print "${te}FAILED at test $next";
+ print ($next > $max) ? "\tpossibly due to extra output\n" : "\n";
$bad = $bad + 1;
$_ = $test;
if (/^base/) {