| expect-compare {testthat} | R Documentation |
This is useful for ensuring returned value is below a ceiling or above a floor.
expect_less_than(object, expected, ..., info = NULL, label = NULL, expected.label = NULL) expect_lt(object, expected) expect_lte(object, expected) expect_more_than(object, expected, ..., info = NULL, label = NULL, expected.label = NULL) expect_gt(object, expected) expect_gte(object, expected)
object |
object to test |
expected |
Expected value |
... |
other values passed to |
info |
extra information to be included in the message (useful when writing tests in loops). |
label |
For full form, label of expected object used in error
messages. Useful to override default (deparsed expected expression) when
doing tests in a loop. For short cut form, object label. When
|
expected.label |
Equivalent of |
Other expectations: equivalence,
expect_equal,
expect_equivalent,
expect_identical;
expect_equal_to_reference;
expect_error, expect_match,
expect_message,
expect_output,
expect_warning,
matching-expectations;
expect_false, expect_true;
expect_is; expect_named;
expect_null; expect_silent;
takes_less_than
a <- 9 expect_less_than(a, 10) ## Not run: expect_less_than(11, 10) ## End(Not run) a <- 11 expect_more_than(a, 10) ## Not run: expect_more_than(9, 10) ## End(Not run)