tests/testthat/test-display_name.R

test_that("display_name returns expected result", {

  # Custom mapping
  mapping <- list(
    col1 = "Column 1",
    col2 = "Column 2"
  )

  expect_equal(display_name("col1", mapping), "Column 1")
  expect_equal(display_name("col2", mapping), "Column 2")

  # Non-mapped values
  expect_equal(display_name("col3", mapping), "col3")

})

Try the vvshiny package in your browser

Any scripts or data that you put into this service are public.

vvshiny documentation built on July 26, 2023, 5:50 p.m.