a <- letters[1:3]
expect_that(a, is_identical_to(c("a", "b", "c")))
expect_identical(a, c("a", "b", "c"))
# Identical does not take into account numeric tolerance
expect_that(sqrt(2) ^ 2, is_identical_to(2))
expect_identical(sqrt(2) ^ 2, 2)
Run the code above in your browser using DataLab