Test::Unit::Assertion(3pm) | User Contributed Perl Documentation | Test::Unit::Assertion(3pm) |
Test::Unit::Assertion - The abstract base class for assertions
Any assertion class that expects to plug into Test::Unit::Assert needs to implement this interface.
$_[0]->do_assertion(@_[1 .. $#_]) || $self->fail("Assertion failed");
This means that "do_assertion" should return true if the assertion succeeds and false if it doesn't. Or, you can fail by throwing a Test::Unit::Failure object, which will get caught further up the stack and used to produce a sensible error report. Generally it's good practice for do_assertion to die with a meaningful error on assertion failure rather than just returning false.
Copyright (c) 2001 Piers Cawley <pdcawley@iterative-software.com>.
All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2015-12-30 | perl v5.22.1 |