Changeset 31148 in project


Ignore:
Timestamp:
07/27/14 06:23:23 (6 years ago)
Author:
svnwiki
Message:

Anonymous wiki edit for IP [180.22.74.163]: clarifying test-epsilon behavior on zero

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/test

    r29738 r31148  
    3333The basic test interface; really all you need to use.  It will catch errors and
    3434print informative failure messages, including the name
    35 (which must be a string literal if present, and
     35(which must be a string if present, and
    3636defaults to an abbreviated form of the test expression),
    3737the source, and the line number information of the failed
    3838expression.  Equality is checked with EQUAL?, unless the expected
    3939value is inexact, in which case it checks to be sure the
    40 percentage difference between the result and expected value
     40percentage difference (or absolute difference if one value is zero)
     41between the result and expected value
    4142fall within the TEST-EPSILON parameter of each other.  This is
    4243because it almost never makes sense to test inexact numbers
    4344with EQUAL? or =, and usually you'll want a single epsilon
    44 throughout a range of tests.
     45throughout a range of tests.  However, you can always test =
     46manually with TEST-ASSERT.
    4547
    4648<syntax>(test-assert [<name>] <expression>)</syntax>
Note: See TracChangeset for help on using the changeset viewer.