GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Test::Unit::Assertion(3) User Contributed Perl Documentation Test::Unit::Assertion(3)

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.

new
Creates a new assertion object. Takes whatever arguments you desire. Isn't strictly necessary for the framework to work with this class but is generally considered a good idea.
do_assertion
This is the important one. If Test::Unit::Assert::assert is called with an object as its first argument then it does:

    $_[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.

  • Test::Unit::Assert
  • Test::Unit::CodeRef
  • Test::Unit::Regexp
2001-12-20 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.