diff --git a/R/test_diseasystore.R b/R/test_diseasystore.R index b9b1c3c6..208c0397 100644 --- a/R/test_diseasystore.R +++ b/R/test_diseasystore.R @@ -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.") ) @@ -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`.") ) diff --git a/tests/testthat/test-age_helpers.R b/tests/testthat/test-age_helpers.R index b473fe4b..7df7b592 100644 --- a/tests/testthat/test-age_helpers.R +++ b/tests/testthat/test-age_helpers.R @@ -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") ) @@ -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") ) diff --git a/tests/testthat/test-truncate_interlace.R b/tests/testthat/test-truncate_interlace.R index 3cfb143b..011c6fbc 100644 --- a/tests/testthat/test-truncate_interlace.R +++ b/tests/testthat/test-truncate_interlace.R @@ -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 }