On 12/6/05, chromatic <[EMAIL PROTECTED]> wrote: > On Mon, 2005-12-05 at 07:54 +0000, Luke Palmer wrote: > > > I wonder if there is a macroey thing that we can do here. That is, > > could we make: > > > > ok(1); > > is(1, 1); > > like("foo", /foo/); > > > > Into: > > > > ok(1); > > ok(1 == 1); > > ok("foo" ~~ /foo/); > > Can you do it without giving up the nice diagnostics that > Test::More::is() provides?
The answer to your question was in the next sentence: > > And lexically analyze the argument to ok() to find > > out how to report the error? I guess that wasn't much of an answer, but more of a question. Anyway, yes, that is what I was hoping. However, I agree with Brent Dax about keeping the test module simple--at least for the compiler test suite. However, I think this DWIMmery might work well in module test suites. That still leaves the problem of what to do with fail() and is() in the compiler suite. Here's a handwavey crack at what I was talking about: my $comparators = set <== ~~ eq macro is($arg, ?$reason_tree) { my $reason = $reason_tree.run;