Skip to content

Commit e9580d3

Browse files
committed
test helper function behavior
1 parent 620648e commit e9580d3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/testthat/test-epix_slide.R

+15
Original file line numberDiff line numberDiff line change
@@ -682,3 +682,18 @@ test_that("`epix_slide` doesn't decay date output", {
682682
inherits("Date")
683683
)
684684
})
685+
686+
test_that("`epix_slide` can access objects inside of helper functions", {
687+
helper = function(archive_haystack, time_value_needle) {
688+
archive_haystack %>% epix_slide(has_needle = time_value_needle %in% time_value, before = 365000L)
689+
}
690+
expect_error(
691+
helper(archive_cases_dv_subset, as.Date("2021-01-01")),
692+
NA
693+
)
694+
695+
expect_error(
696+
helper(xx, 3L),
697+
NA
698+
)
699+
})

0 commit comments

Comments
 (0)