[Perlunit-devel] the old 'ok' chestnut
Status: Beta
Brought to you by:
mca1001
From: Adam S. <ad...@sp...> - 2001-11-07 22:32:15
|
It's the old 'ok' issue again, I'm afraid. I think I'm correct in saying that Piers' new assert_equals() method has very neatly solved the previous long-standing objections to PerlUnit having any kind of ok() routine, since it does careful checking to see what type of things are being compared. Maybe I'm being fussy, but once I get PerlUnit set up here at work so that all my cow-orkers can port their existing tests across from using Test.pm, I'm dreading having to tell them they're going to have to change every instance of ok($got, $expected); into $self->assert_equals($expected, $got); (note the reversed order), not to mention ok(<EXPR>); into $self->assert(<EXPR>); and ok($foo, qr/foo/); into $self->assert(qr/foo/, $foo); Bearing in mind that (hopefully) in the future there will be lots of porting from Test to Test::Unit going on, it's probably worth making the transition as painless as possible. To that end, I'm adding an ok() wrapper to do this to the PDC_REFACTOR branch. That's not unreasonable is it? I can mention in the pod that it's best only used during porting, not for writing tests from scratch. |