Skip to content

Commit

Permalink
change tests to reflect new ddply behavior for empty data frames.
Browse files Browse the repository at this point in the history
  • Loading branch information
strongh committed Oct 14, 2010
1 parent 0d84bd5 commit 009b49f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions inst/tests/test-empty.r
Expand Up @@ -20,9 +20,8 @@ test_that("empty lists return an empty object", {

test_that("empty data frames returns empty object", {
df <- data.frame(x = numeric(0), a = numeric(0))
expect_that(ddply(df, "a", identity), equals(data.frame()))
expect_that(dlply(df, "a", identity), equals(list()))
expect_that(daply(df, "a", identity), equals(logical()))
expect_that(length(names(ddply(df, "a", identity))) > 0, is_true())
expect_that(nrow(ddply(df, "a", identity)), equals(0))
})

test_that("empty data frame results returns empty object", {
Expand All @@ -37,4 +36,4 @@ test_that("empty data frame results returns empty object", {
daply(df, "a", function(x) NULL),
throws_error("must have one or more dimensions"))

})
})

0 comments on commit 009b49f

Please sign in to comment.