Skip to content

Commit

Permalink
Split test
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jul 16, 2023
1 parent 16b472f commit 5211dae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/testthat/test-summarise.R
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ test_that("named tibbles are packed (#2326)", {
expect_equal(out$df, tibble(y = 4, z = 3))
})

test_that("summarise(.groups=)", {
test_that("summarise(.groups=) in global environment", {
expect_message(eval_bare(
expr(data.frame(x = 1, y = 2) %>% group_by(x, y) %>% summarise()),
env(global_env())
Expand All @@ -302,7 +302,9 @@ test_that("summarise(.groups=)", {
expr(data.frame(x = 1, y = 2) %>% rowwise(x, y) %>% summarise()),
env(global_env())
))
})

test_that("summarise(.groups=)", {
df <- data.frame(x = 1, y = 2)
expect_equal(df %>% summarise(z = 3, .groups= "rowwise"), rowwise(data.frame(z = 3)))

Expand Down

0 comments on commit 5211dae

Please sign in to comment.