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


Manual Reference Pages  -  TEST::TOLERANT (3)

.ds Aq ’

NAME

Test::Tolerant - test routines for testing numbers against tolerances

CONTENTS

VERSION

version 1.708

SYNOPSIS



  use Test::More;
  use Test::Tolerant;

  my $total = rand(6) + rand(6) + rand(6);
  is_tol(10, [ qw( 3 to 18 ) ], "got an acceptable result from random dice");

  done_testing;



FUNCTIONS

    is_tol



  is_tol($have, $want_spec, $comment);



is_tol is the only routine provided by Test::Tolerant, and is exported by default. It beahves like is from Test::More, asserting that two values must be equal, but it will always use numeric equality, and the second argument is not always used as the right hand side of comparison directly, but it used to produce a Number::Tolerant to compare to.

$have_spec can be:



  * a Number::Tolerant object
  * an arrayref of args to Number::Tolerant->new
  * a string to be passed to Number::Tolerant->from_string
    * a literal number falls under this group



If the value is outside of spec, you’ll get a diagnostic message something like this:



  given value is outside acceptable tolerances
      have: 3
      want: 5 < x



AUTHOR

Ricardo Signes <rjbs@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2004 by Ricardo Signes.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

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


perl v5.20.3 TEST::TOLERANT (3) 2015-11-01

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