3 * Checks that the first two arguments are equal, or are numbers close enough to be considered equal
4 * based on a specified maximum allowable difference.
6 * @example close(3.141, Math.PI, 0.001);
9 * @param Number expected
10 * @param Number maxDifference (the maximum inclusive difference allowed between the actual and expected numbers)
11 * @param String message (optional)
13 close: function(actual
, expected
, maxDifference
, message
) {
14 var passes
= (actual
=== expected
) || Math
.abs(actual
- expected
) <= maxDifference
;
15 QUnit
.push(passes
, actual
, expected
, message
);
19 * Checks that the first two arguments are numbers with differences greater than the specified
22 * @example notClose(3.1, Math.PI, 0.001);
24 * @param Number actual
25 * @param Number expected
26 * @param Number minDifference (the minimum exclusive difference allowed between the actual and expected numbers)
27 * @param String message (optional)
29 notClose: function(actual
, expected
, minDifference
, message
) {
30 QUnit
.push(Math
.abs(actual
- expected
) > minDifference
, actual
, expected
, message
);