Skip to content

Commit

Permalink
another factor test
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinErickson committed Aug 15, 2019
1 parent 8b084ac commit 947f28d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/testthat/test_ffexp.R
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,23 @@ test_that("Test add_variable", {
expect_error({rm(f1, g1); gc()}, NA)
})

test_that("ffexp with factor input", {
f1 <- ffexp$new(n=factor(c(100, 1000, 10000)),
nulleff=factor(c(0,1)),
eval_func=function(n, nulleff) {
samp <- rnorm(n)
data.frame(mean=mean(samp), se=sd(samp)/sqrt(n))}
)
expect_is(f1$arglist[[1]], "factor")
expect_is(f1$arglist[[2]], "factor")
f1$run_all()
expect_true(all(f1$completed_runs))
expect_error(f1$rungrid2(), NA)
expect_equal(colnames(f1$rungrid2()), c('n', 'nulleff'))
# Delete at end
expect_error({rm(f1); gc()}, NA)
})

test_that("ffexp with factor input and df multirow output", {
f1 <- ffexp$new(a=1:2,b=c("b",'c'), c=factor(c(5,6)),
eval_func=function(a,b,c) {tibble::tibble(a=1:3,b=letters[1:3])})
Expand Down

0 comments on commit 947f28d

Please sign in to comment.