powered by
An old style of testing that's no longer encouraged.
expect_that(object, condition, info = NULL, label = NULL)
object to test
a function that returns whether or not the condition is met, and if not, an error message to display.
extra information to be included in the message (useful when writing tests in loops).
object label. When NULL, computed from deparsed object.
NULL
the (internal) expectation result as an invisible list
fail() for an expectation that always fails.
fail()
# NOT RUN { expect_that(5 * 2, equals(10)) expect_that(sqrt(2) ^ 2, equals(2)) # } # NOT RUN { expect_that(sqrt(2) ^ 2, is_identical_to(2)) # }
Run the code above in your browser using DataLab