Skip to content

Commit

Permalink
feat: test for non-integer values
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsantiagoquevedo committed Feb 24, 2024
1 parent 3a12fe3 commit 49a7e20
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/testthat/test-get_age_group.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ test_that("`get_age_groups`: Input checking", {
regexp = "Assertion on 'min_val' failed: May not be NA"
)

# non-integer values passed
expect_error(
get_age_group(
data = cohortdata,
col_age = "age",
min_val = 0.7,
max_val = 1,
step = 1
)
)

# step size is larger than difference in age limits
# maximum age is less than the minimum age
max_age <- 80
Expand Down

0 comments on commit 49a7e20

Please sign in to comment.