Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

make_expectation

Make an equality test.


Description

This a convenience function to make a expectation that checks that input stays the same.

Usage

make_expectation(x, expectation = "equals")

Arguments

x

a vector of values

expectation

the type of equality you want to test for ("equals", "is_equivalent_to", "is_identical_to")

Examples

x <- 1:10
make_expectation(x)

make_expectation(mtcars$mpg)

df <- data.frame(x = 2)
make_expectation(df)

testthat

Unit Testing for R

v3.0.2
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph, fnd], R Core team [ctb] (Implementation of utils::recover())
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.