TAP for Perl 6
Michael G Schwern
schwern at pobox.com
Thu Jan 22 01:24:51 GMT 2009
Ovid wrote:
> Currently that should output something like:
>
> not ok 1 - Should be true
> # Expected a true value
> # have: 0
>
> The first line of the diagnostic can be overridden (and sometimes is) and I'm not trying to conform to the "proper" YAML/JSON spec because Perl 6 is missing a few keys things and we haven't nailed this down. However, I still want to figure out a few things better. We don't have normal have/want lines for boolean assertions, so what should they be? (Also, you can specify 'verbose' mode for tests and you'll get diagnostics for every test, not just failing).
ok() having a diagnostic isn't so handy in Perl 5 because there's only a
handful of false values. That you got '' as opposed to 0 or undef isn't
terribly useful.
In Perl 6, since truthiness is detached from value, it is useful. For example...
ok system "some_program";
Might produce...
not ok 1
# Expected a true value
# have: 1
It's useful to know that system() returned 1 but false.
> I think we need a clean way of specifying how the comparison is made. "1.0" == "1.00" but it does not eq "1.00". How should I render that?
# Failed $have eq $want
# have: "1.00"
# want: "1.0"
--
"Clutter and overload are not an attribute of information,
they are failures of design"
-- Edward Tufte
More information about the tapx-dev
mailing list