closeTo: Returns a function that checks whether its _argument_ is...

Description Usage Arguments Details See Also Examples

View source: R/hamcrest.R

Description

Returns a function that checks whether its argument is close to an expected result within the given tolerance

Usage

1
closeTo(expected, delta)

Arguments

expected

a numeric vector.

delta

a numeric vector of length one that defines the maximum allowed difference.

Details

The closeTo() matcher function can only be used for numeric arguments.

See Also

Examples

1
2
3
4
## Not run: 
assertThat(-0.50557992900139, closeTo(-0.50557, delta = 1e4))

## End(Not run)

bedatadriven/hamcrest documentation built on Dec. 1, 2019, 1:49 p.m.