Skip to content

Commit

Permalink
Update to expect_identical from expect_equal (#104)
Browse files Browse the repository at this point in the history
* Removed tolerance from expect_equal

* change function for lintr

---------

Co-authored-by: Shiyu Chen <[email protected]>
  • Loading branch information
ShiyuC and Shiyu Chen authored Nov 11, 2024
1 parent 966ab97 commit b6e634f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/test-derive_study_day.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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)
})

0 comments on commit b6e634f

Please sign in to comment.