Skip to content

Does code return a number greater/less than the expected value?

Usage

expect_lt(object, expected, label = NULL, expected.label = NULL)

expect_lte(object, expected, label = NULL, expected.label = NULL)

expect_gt(object, expected, label = NULL, expected.label = NULL)

expect_gte(object, expected, label = NULL, expected.label = NULL)

Arguments

object, expected

A value to compare and its expected bound.

label, expected.label

Used to customise failure messages. For expert use only.

Examples

a <- 9
expect_lt(a, 10)

if (FALSE) { # \dontrun{
expect_lt(11, 10)
} # }

a <- 11
expect_gt(a, 10)
if (FALSE) { # \dontrun{
expect_gt(9, 10)
} # }