On Mar 15, 2005, at 10:32 AM, Luke Palmer wrote:
Stevan Little writes:
On Mar 15, 2005, at 6:45 AM, Nathan Gray wrote:
I think it would be really nice for failed, todo, and skipped tests to
log their $expected and $got values, with any $desc or $context
information to a log file (probably test.log).
I also think it would be very nice to be able to use other operators, such as gt, lt, or isa.
is($got, $expected, $desc, operator => 'gt');
Personally, I think a more familiar form, like Test::More::cmp_ok would
be better.
cmp_ok($got, 'gt', $expected, $desc);
It should be easy enough to implement.
And of course in Perl 6, you can do that with:
cmp_ok($got, &infix:<gt>, $expected, $desc);
So that you can use operators which a) aren't infix, or b) implemented locally.
So if I understand you correctly, then the implementation code would look something like this right?
sub cmp_ok (Str $got, Code $comparison_func, Str $expected, Str ?$desc) returns Bool is export {
my $test := $comparison_func($got, $expected);
....
}
- Stevan
Luke