Perl 6 Test.pm

Ovid on 2009-01-12T21:17:45

In writing tests for the .trim function, I kept getting bitten by the fact that Test.pm does not display any diagnostics. They're currently primitive, but shortly I'll be submitted a patch which shows this:

not ok 28 - 3rd element is trimmed again with no effect # TODO trim on lists
# have: undef
# want: "baz"
not ok 29 - 0 is not true # TODO expected failures
# Expected a true value.
# have: 0
not ok 30 - expected failure # TODO expected failures
# Expected a false value.
# have: ["a", "b", "c"]
not ok 31 -
# have: ["a", "b", "c"]
# want: ["a", "b", "z"]

I've not gone the full YAML/JSON route because diagnostics for TAP are not yet fully specced and I wanted something down now. Also, note that boolean output explains itself much better than it did previously. And because this all goes to STDOUT, there are NO FRICKIN' SYNCHRONIZATION ISSUES that we get with the STDOUT/STDERR mess with Perl 5. This pleases me :)

I hope to have a patch tonight or the day after tomorrow (busy tomorrow).

It also implements 'die_on_fail' but I don't have 'no_plan' due to problems with END blocks not recognizing variables declared outside of their scope.