Skip to content

Commit e11741c

Browse files
committed
add comparison tests with date/time and NA
1 parent babcde2 commit e11741c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/testthat/test-expect-comparison.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ test_that("comparisons with Date objects work", {
8484
expect_snapshot_failure(expect_gt(date, date2))
8585
})
8686

87+
test_that("comparisons of date/time with NA work", {
88+
time <- as.POSIXct("2020-01-01 01:00:00")
89+
date <- as.Date("2020-01-01")
90+
91+
expect_failure(expect_lt(time, NA))
92+
expect_failure(expect_gt(date, NA))
93+
})
94+
8795
test_that("comparisons with character objects work", {
8896
expect_success(expect_lte("a", "b"))
8997

0 commit comments

Comments
 (0)