From b6e634f6cd24041e0c1fb20f0907d18fea994ab9 Mon Sep 17 00:00:00 2001 From: Shiyu Chen <39443807+ShiyuC@users.noreply.github.com> Date: Mon, 11 Nov 2024 13:04:39 -0800 Subject: [PATCH] Update to expect_identical from expect_equal (#104) * Removed tolerance from expect_equal * change function for lintr --------- Co-authored-by: Shiyu Chen --- tests/testthat/test-derive_study_day.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-derive_study_day.R b/tests/testthat/test-derive_study_day.R index 2b6628f6..ca5d45c6 100644 --- a/tests/testthat/test-derive_study_day.R +++ b/tests/testthat/test-derive_study_day.R @@ -59,7 +59,7 @@ test_that("`derive_study_day()` works as expected for invalid input", { test_that("`calculate_study_day()` works as expected for valid input", { res <- derive_study_day(ae, dm, "AESTDTC", "RFSTDTC", "AESTDY") expected <- c(-31L, 1L, NA) - expect_equal(res$AESTDY, expected, tolerance = 1.5e-08) + expect_identical(res$AESTDY, expected) df <- data.frame( USUBJID = c("study123-123", "study123-124", "study123-125"), @@ -68,5 +68,5 @@ test_that("`calculate_study_day()` works as expected for valid input", { stringsAsFactors = FALSE ) res1 <- derive_study_day(df, df, "AESTDTC", "RFSTDTC", "AESTDY") - expect_equal(res1$AESTDY, expected, tolerance = 1.5e-08) + expect_identical(res1$AESTDY, expected) })