Skip to content

Commit

Permalink
Add new test
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Aug 6, 2023
1 parent 9133b7a commit 6b64951
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/testthat/test-count-tally.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ test_that("count can sort output", {
expect_equal(out, tibble(x = c(2, 1), n = c(3, 2)))
})

test_that("count can rename grouping columns", {
df <- tibble(x = c(2, 1, 1, 2, 1))
out <- count(df, y = x)
expect_equal(out, tibble(y = c(1, 2), n = c(3, 2)))
})

test_that("informs if n column already present, unless overridden", {
df1 <- tibble(n = c(1, 1, 2, 2, 2))
expect_message(out <- count(df1, n), "already present")
Expand Down

0 comments on commit 6b64951

Please sign in to comment.