tests/testthat/test-data.R

# Work in progress. The book on R packages only mentions examples
# of tests for functions, so make sure to have a look at some test-
# directories of data-focused packages like covdata. Creating tests
# for data is very different from creating tests for functions.

# context("Datasets")
# library(PPBDS.data)

# cces
# test_that("str_length is number of characters", {
#  expect_equal(str_length("a"), 1)
#  expect_equal(str_length("ab"), 2)
#  expect_equal(str_length("abc"), 3)
# })

# test_that("no rows with same value for every variable", {
#  expect_equal(str_length(factor("a")), 1)
#  expect_equal(str_length(factor("ab")), 2)
#  expect_equal(str_length(factor("abc")), 3)
# })
davidkane9/PPBDS.data documentation built on Nov. 18, 2020, 1:17 p.m.