tests/testthat/test-flag.R

context("flag")

test_that("flag errors if pattern does not identify a single name", {
  expect_error( flag( "fr" ) )
  expect_error( flag( "fezffez" ) )
})

test_that("flag keeps some metadata", {
  chile <- flag( "Chile")
  expect_equal( attr(chile, "name"), "Chile" )
})
hadley/emo documentation built on Dec. 16, 2019, 3:42 p.m.