Skip to content

Commit

Permalink
more tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
edward-burn committed Oct 22, 2024
1 parent d535755 commit 5d96ff4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/testthat/test-requireCohortIntersect.R
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ test_that("different intersection count requirements", {
window = c(-Inf, Inf),
targetCohortTable = "cohort2",
name = "cohort1_test") |>
dplyr::pull("subject_id")), c(4,5,6,7,8,9,10))
dplyr::pull("subject_id")), as.integer(c(4,5,6,7,8,9,10)))


# only one intersection
Expand All @@ -220,15 +220,15 @@ test_that("different intersection count requirements", {
window = c(-Inf, Inf),
targetCohortTable = "cohort2",
name = "cohort1_test") |>
dplyr::pull("subject_id")), c(1))
dplyr::pull("subject_id")), c(1L))

expect_identical(sort(cdm$cohort1 |>
requireCohortIntersect(intersections = c(1),
targetCohortId = 1,
window = c(-Inf, Inf),
targetCohortTable = "cohort2",
name = "cohort1_test") |>
dplyr::pull("subject_id")), c(1))
dplyr::pull("subject_id")), c(1L))

# 2 intersections
expect_identical(sort(cdm$cohort1 |>
Expand All @@ -237,15 +237,15 @@ test_that("different intersection count requirements", {
window = c(-Inf, Inf),
targetCohortTable = "cohort2",
name = "cohort1_test") |>
dplyr::pull("subject_id")), c(2))
dplyr::pull("subject_id")), c(2L))

expect_identical(sort(cdm$cohort1 |>
requireCohortIntersect(intersections = c(2),
targetCohortId = 1,
window = c(-Inf, Inf),
targetCohortTable = "cohort2",
name = "cohort1_test") |>
dplyr::pull("subject_id")), c(2))
dplyr::pull("subject_id")), c(2L))


# 2 or more intersections
Expand All @@ -255,7 +255,7 @@ test_that("different intersection count requirements", {
window = c(-Inf, Inf),
targetCohortTable = "cohort2",
name = "cohort1_test") |>
dplyr::pull("subject_id")), c(2, 3))
dplyr::pull("subject_id")), c(2L, 3L))

# 2 or 3 intersections
expect_identical(sort(cdm$cohort1 |>
Expand All @@ -264,7 +264,7 @@ test_that("different intersection count requirements", {
window = c(-Inf, Inf),
targetCohortTable = "cohort2",
name = "cohort1_test") |>
dplyr::pull("subject_id")), c(2, 3))
dplyr::pull("subject_id")), c(2L, 3L))



Expand Down

0 comments on commit 5d96ff4

Please sign in to comment.