tests/testthat/test-col_types.R

test_that("You can use !! in cols and cols_only", {
  var <- "xyz"
  expect_equal(
    cols(!!var := col_character()),
    cols(xyz = col_character())
  )

  expect_equal(
    cols_only(!!var := col_character()),
    cols_only(xyz = col_character())
  )
})

test_that("format(col_spec) contains the delimiter if specified", {
  expect_match(fixed = TRUE,
    format(cols(.delim = "\t")),
    '.delim = "\\t"'
  )
})

Try the vroom package in your browser

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

vroom documentation built on June 23, 2021, 1:07 a.m.