Skip to content

Commit

Permalink
test: Update the expectations after expect_identical change
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusSkytte committed Jan 10, 2025
1 parent 0061904 commit 45d95a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions R/test_diseasystore.R
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ test_diseasystore <- function(

testthat::expect_identical(
SCDB::nrow(reference_out_of_bounds),
0,
0L,
info = glue::glue("Feature `{.x}` returns data outside the study period.")
)

Expand All @@ -353,14 +353,14 @@ test_diseasystore <- function(
# Remember that data is valid in the interval [valid_from, valid_until) and NA is treated as infinite
testthat::expect_identical(
SCDB::nrow(dplyr::filter(reference, is.na(.data$valid_from))),
0
0L
)

testthat::expect_identical(
reference |>
dplyr::filter(.data$valid_from >= .data$valid_until) |>
SCDB::nrow(),
0,
0L,
info = glue::glue("Feature `{.x}` has some elements where `valid_from` >= `valid_until`.")
)

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-age_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ test_that("age_on_date() works for date input", {

}

expect_identical(
expect_equal( # nolint: expect_identical_linter. The return data types from the different database backends may not always be identical
dplyr::pull(test_ages, "age"),
dplyr::pull(reference_ages, "age")
)
Expand Down Expand Up @@ -118,7 +118,7 @@ test_that("age_on_date() works for reference input", {

}

expect_identical(
expect_equal( # nolint: expect_identical_linter. The return data types from the different database backends may not always be identical
dplyr::pull(test_ages, "age"),
dplyr::pull(reference_ages, "age")
)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-truncate_interlace.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ test_that("truncate_interlace works", {
max_date_secondary <- purrr::reduce(purrr::map(secondary, ~ max(.x$valid_until)), max)
max_date <- min(max_date_secondary, max(primary$valid_until))

expect_identical(min(output$valid_from), min_date)
expect_identical(max(output$valid_until), max_date)
expect_equal(min(output$valid_from), min_date) # nolint: expect_identical_linter. The return data types from the different database backends may not always be identical
expect_equal(max(output$valid_until), max_date) # nolint: expect_identical_linter. The return data types from the different database backends may not always be identical

}

Expand Down

0 comments on commit 45d95a0

Please sign in to comment.