Skip to content

Commit

Permalink
Update test-sampleCohorts.R
Browse files Browse the repository at this point in the history
  • Loading branch information
nmercadeb committed Oct 16, 2024
1 parent 17a7a32 commit db6c49c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/test-sampleCohorts.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test_that("sampleCohort subsetting one cohort", {
schema = "main",
overwrite = TRUE)

cdm$cohort1 <- sampleCohorts(cdm$cohort1, 2, 1)
cdm$cohort1 <- sampleCohorts(cdm$cohort1, n = 2, cohortId = 1)
expect_true(cdm$cohort1 |>
dplyr::filter(cohort_definition_id == 1) |>
dplyr::pull("subject_id") |>
Expand All @@ -18,7 +18,7 @@ test_that("sampleCohort subsetting one cohort", {
dplyr::pull("cohort_definition_id") == 1)

# Subset it again should yield the same cohort
test_cohort1 <- sampleCohorts(cdm$cohort1, 2, 1)
test_cohort1 <- sampleCohorts(cdm$cohort1, n = 2, cohortId = 1)
expect_true(all.equal(test_cohort1, cdm$cohort1))
expect_true(attrition(test_cohort1) |>
dplyr::filter(reason == "Sample 2 individuals" & reason_id == 3) |>
Expand Down

0 comments on commit db6c49c

Please sign in to comment.