Skip to content

Commit 0b48ea4

Browse files
committed
test helper function behavior
1 parent 307fb6e commit 0b48ea4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/testthat/test-epi_slide.R

+10
Original file line numberDiff line numberDiff line change
@@ -510,3 +510,13 @@ test_that("epi_slide computation via dots outputs the same result using col name
510510

511511
expect_identical(result1, expected_output)
512512
})
513+
514+
test_that("`epi_slide` can access objects inside of helper functions", {
515+
helper = function(archive_haystack, time_value_needle) {
516+
archive_haystack %>% epi_slide(has_needle = time_value_needle %in% time_value, before = 365000L)
517+
}
518+
expect_error(
519+
helper(small_x, as.Date("2021-01-01")),
520+
NA
521+
)
522+
})

0 commit comments

Comments
 (0)