Re: [Perlunit-devel] the old 'ok' chestnut
Status: Beta
Brought to you by:
mca1001
|
From: Piers C. <pdc...@bo...> - 2001-11-08 08:45:02
|
"Hans Donner" <han...@us...> writes:
> I think you're at risk that youre co-workers will keep using the
> ok() tests instead of the $self->assert. I think they better write
> th ok wrapper themselves, instead of providing it if they want to
> keep the ok.
Maybe if we provide our own 'ok' wrapper, but have it throw a
'DEPRECATED' warning the first time it's called in any program run.
Test::Unit::Assert::ok is deprecated, please consider moving over
to using Test::Unit::Assert::assert_equals and friends when
writing PerlUnit tests.
If we just make that happen once per run in a way that can be
overridden (by the user defining a constant OK_IS_OK or something)
then we get the message across.
BTW, why didn't we want 'ok'?
Note too that if 'ok' is going to be a wrapper round assert_equals then
it's going to fail in the case 'ok $got, qr/$expected_pattern/'
because assert_equals doesn't do regex matching (because when all's
said and done 'matches a regex' is a strange definition of 'equals')
--
Piers
"It is a truth universally acknowledged that a language in
possession of a rich syntax must be in need of a rewrite."
-- Jane Austen?
|