tests/testthat/test_lvec_type.R

context("Get type of lvec")

test_that("getting type of lvec works", {
  expect_that(lvec_type(lvec(10, "integer")), equals("integer"))
  expect_that(lvec_type(lvec(10, "numeric")), equals("numeric"))
  expect_that(lvec_type(lvec(10, "logical")), equals("logical"))
  expect_that(lvec_type(lvec(10, "character", strlen = 5)), equals("character"))
  expect_error(lvec_type(1:10))
})

Try the lvec package in your browser

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

lvec documentation built on May 24, 2018, 9:04 a.m.