Skip to contents

[Experimental]

Check whether x is a shiny tag.

Usage

check_tag(x, null.ok = FALSE)

assert_tag(x, null.ok = FALSE, .var.name = checkmate::vname(x), add = NULL)

test_tag(x, null.ok = FALSE)

expect_tag(x, null.ok = FALSE, info = NULL, label = vname(x))

Arguments

x

an object to check.

null.ok

(flag)
whether x may also be NULL.

.var.name

(string)
name of the checked object to print in assertions; defaults to the heuristic implemented in checkmate::vname().

add

(AssertCollection or NULL)
collection to store assertion messages, see checkmate::AssertCollection.

info

(string)
extra information to be included in the message for the testthat reporter, see testthat::expect_that().

label

(string)
name of the checked object to print in messages. Defaults to the heuristic implemented in checkmate::vname().

See also

assertions for more details.

Examples

check_tag("bla")
#> [1] "Must be a 'shiny.tag' or NULL"
check_tag(NULL, null.ok = TRUE)
#> [1] TRUE