test_that("%||% works", {
expect_true(NULL %||% TRUE)
expect_false(FALSE %||% TRUE)
})
test_that("%|W|% works", {
expect_true(waiver() %|W|% TRUE)
expect_false(FALSE %||% TRUE)
})
test_that("vec_ifelse works", {
yes <- vec_cast(c(NA, 1, 10), new_datetime())
no <- vec_cast(c(10, 2, 4), new_date())
test <- c(TRUE, FALSE, NA)
out <- vec_ifelse(test, yes, no)
expect_is(out, "POSIXct")
expect_identical(as.integer(out), c(NA_integer_, 169200L, NA_integer_))
})
test_that("borrowing ggplot2 internals work", {
x <- .grab_ggplot_internals()
expect_is(x$Range, "Range")
expect_is(x$Range, "gg")
expect_is(x$check_breaks_labels, "function")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.