powered by
Express expectations
expect_equal(current, target, tol = sqrt(.Machine$double.eps), ...)expect_identical(current, target)expect_equivalent(current, target, tol = sqrt(.Machine$double.eps), ...)expect_true(current)expect_false(current)expect_error(current, pattern = ".*")expect_warning(current, pattern = ".*")
expect_identical(current, target)
expect_equivalent(current, target, tol = sqrt(.Machine$double.eps), ...)
expect_true(current)
expect_false(current)
expect_error(current, pattern = ".*")
expect_warning(current, pattern = ".*")
[R object or expression] Outcome or expression under scrutiny.
[R object or expression]
[R object or expression] Expected outcome
[numeric] Test equality to machine rounding. Passed to all.equal (tolerance)
[numeric]
all.equal (tolerance)
Passed to all.equal
all.equal
[character] A regular expression to match the message.
[character]
A tinytest object. A tinytest object is a logical with attributes holding information about the test that was run
tinytest
logical
expect_equivalent calls expect_equal with the extra arguments check.attributes=FALSE and use.names=FALSE
expect_equivalent
expect_equal
check.attributes=FALSE
use.names=FALSE
Other test-functions: ignore
ignore
# NOT RUN { expect_equal(1 + 1, 2) # TRUE expect_equal(1 - 1, 2) # FALSE expect_equivalent(2, c(x=2)) # TRUE expect_equal(2, c(x=2)) # FALSE # }
Run the code above in your browser using DataLab