Re: [Perlunit-devel] Greetings
Status: Beta
Brought to you by:
mca1001
From: Adam S. <ad...@sp...> - 2001-12-11 18:12:44
|
Adam Spiers (ad...@sp...) wrote: > Piers Cawley (pdc...@bo...) wrote: > > Matthias Ferber <mf...@hi...> writes: > > How about: > > > > $self->assert_matches(qr/.../, $value, $message) > > $self->assert_does_not_match(qr/.../, $value, $message) > > > > assert_matches is almost exactly like assert(qr/.../), but it fails if > > it's not passed a pattern as its first argument. > > Sounds good. I might hack that up now ... Done. I actually ended up making substantial improvements to AssertTest.pm, so the tests therein are even more stringent than before. As a result it's even more likely that if I cocked something up, it's broken 'make test'. Works for me of course, but please cvs update and test. Here's the log message for those not on perlunit-commits yet: - Add new assert_matches() and assert_does_not_match() assertions, as requested by Matthias Ferber, and new tests for them of course. - Start testing for the correct messages in T::U::Failure objects (see check_exception()). In particular this tests that the optional MESSAGE args are processed correctly when reporting failures. - Improved behaviour of assert_equals() and assert_not_equals() with undefined parameters. - Added more stringent tests for assert_equals() and assert_not_equals(). Some of these are possibly debatable. I think the assert_equals() matrix should be retired in favour of the check_failures() style tests used to check assert_not_equals(), since the latter also check the failure message and originating file/line (added a #FIXME for this). - Fixed reversed got/expected message with $self->ok(sub { 2 + 2 }, 4); Spotted this as a bonus of the new check_exception(), yay. I'm off to Jersey tomorrow morning until Sunday, so I won't be available until I get back. |