comparison-expectations {testthat} | R Documentation

## Expectation: is returned value less or greater than specified value?

### Description

Expectation: is returned value less or greater than specified 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` | Object to test. Supports limited unquoting to make it easier to generate readable failures within a function or for loop. See quasi_label for more details.
`expected` | Single numeric value to compare.
`label` | Used to customise failure messages. For expert use only.
`expected.label` | Used to customise failure messages. For expert use only.
`...` | For `expect_equal()` and `expect_equivalent()`, passed on `compare()`, for `expect_identical()` passed on to `identical()`. Used to control the details of the comparison.

### See Also

Other expectations: `equality-expectations`, `expect_length`, `expect_match`, `expect_named`, `expect_null`, `inheritance-expectations`, `logical-expectations`, `output-expectations`

### Examples

    a <- 9
    expect_lt(a, 10)

    ## Not run:
    expect_lt(11, 10)

    ## End(Not run)

    a <- 11
    expect_gt(a, 10)
    ## Not run:
    expect_gt(9, 10)

    ## End(Not run)

[Package testthat version 2.1.1 Index]