Skip to content

Commit 6b20eaa

Browse files
committed
Add more tests
1 parent ca694f6 commit 6b20eaa

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

r/tests/testthat/test-dplyr-funcs-conditional.R

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,10 @@ test_that("external objects are found when they're not in the global environment
519519
})
520520

521521
test_that("when_any()", {
522-
# combines with OR
522+
# combines with OR (3 inputs)
523523
compare_dplyr_binding(
524524
.input |>
525-
mutate(result = when_any(lgl, false)) |>
525+
mutate(result = when_any(lgl, false, int > 5)) |>
526526
collect(),
527527
tbl
528528
)
@@ -543,6 +543,14 @@ test_that("when_any()", {
543543
tbl
544544
)
545545

546+
# single input
547+
compare_dplyr_binding(
548+
.input |>
549+
mutate(result = when_any(lgl)) |>
550+
collect(),
551+
tbl
552+
)
553+
546554
# size not supported
547555
expect_arrow_eval_error(
548556
when_any(lgl, false, size = 10),
@@ -552,10 +560,10 @@ test_that("when_any()", {
552560
})
553561

554562
test_that("when_all()", {
555-
# combines with AND
563+
# combines with AND (3 inputs)
556564
compare_dplyr_binding(
557565
.input |>
558-
mutate(result = when_all(lgl, false)) |>
566+
mutate(result = when_all(lgl, int > 0, dbl > 1)) |>
559567
collect(),
560568
tbl
561569
)
@@ -576,6 +584,14 @@ test_that("when_all()", {
576584
tbl
577585
)
578586

587+
# single input
588+
compare_dplyr_binding(
589+
.input |>
590+
mutate(result = when_all(lgl)) |>
591+
collect(),
592+
tbl
593+
)
594+
579595
# size not supported
580596
expect_arrow_eval_error(
581597
when_all(lgl, false, size = 10),

0 commit comments

Comments
 (0)