Skip to content

Commit

Permalink
adding test
Browse files Browse the repository at this point in the history
  • Loading branch information
nfultz committed Mar 22, 2018
1 parent b0cc13f commit 66d79c4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/testthat/test-helper-functions.R
Expand Up @@ -77,6 +77,19 @@ test_that("Error handlers: check_rectangular", {
expect_error(check_rectangular(test, N))
})

test_that("Error handlers: check_rectangular nested structures", {

sleep[["nested"]] <- list(sleep)
N <- 20
expect_true(is.data.frame(check_rectangular(sleep, N)))

sleep <- as.list(sleep)
sleep$mtcars <- mtcars

expect_error(check_rectangular(sleep, N))
})


test_that("get_unique_variables_by_level", {
df <- datasets::ChickWeight
expect_equal(length(get_unique_variables_by_level(df, "Diet")), 0)
Expand Down

0 comments on commit 66d79c4

Please sign in to comment.