When I ran the code below within reprex::reprex() I got the expected error below. When I ran it manually, I got no error.
testthat::expect_equal(
as.POSIXct("2024-08-02 20:47:03.123", tz = "UTC"),
as.POSIXct("2024-08-02 20:47:03", tz = "UTC")
)
#> Error: as.POSIXct("2024-08-02 20:47:03.123", tz = "UTC") not equal to as.POSIXct("2024-08-02 20:47:03", tz = "UTC").
#> 1/1 mismatches
#> [1] 2024-08-02 20:47:03.122 - 2024-08-02 20:47:03 == 0.123 secs
dput(as.POSIXct("2024-08-02 20:47:03.123", tz = "UTC"))
#> structure(1722631623.123, class = c("POSIXct", "POSIXt"), tzone = "UTC")
dput(as.POSIXct("2024-08-02 20:47:03", tz = "UTC"))
#> structure(1722631623, class = c("POSIXct", "POSIXt"), tzone = "UTC")
Created on 2024-08-03 with reprex v2.1.1