Skip to content

Commit eb7cbed

Browse files
committed
Change test on date
Date output is tested as character to avoid numeric rounding problems on r-devel-windows-x86_64-gcc10-UCRT issue #14
1 parent 78fec46 commit eb7cbed

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

dev_history.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ rhub::check_for_cran()
8080
rhub::check_on_windows(check_args = "--force-multiarch")
8181
rhub::check_on_fedora()
8282
rhub::check_on_solaris()
83+
rhub::check_on_windows()
84+
8385
devtools::check_win_devel()
8486
devtools::check_win_release()
8587

tests/testthat/test-get_info_files.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ repo_no_pkg <- fake_repo()
55
files <- list.files(repo_pkg, recursive = TRUE)
66
infos <- get_info(files[grep("example", files)], repo = repo_pkg)
77
infos_not_in_repo <- get_info(files[grep("my_mean", files)], repo = repo_pkg)
8-
today <- Sys.Date()
8+
today <- as.character(Sys.Date())
99

1010
test_that("get_info works", {
1111
expect_true(infos$in_repository)
1212
expect_equal(infos$file, "example.txt")
13-
expect_equal(as.Date(infos$first_modif), setNames(today, "first"))
14-
expect_equal(as.Date(infos$last_modif), setNames(today, "last"))
13+
expect_equal(as.character(as.Date(infos$first_modif)), setNames(today, "first"))
14+
expect_equal(as.character(as.Date(infos$last_modif)), setNames(today, "last"))
1515

1616
expect_false(infos_not_in_repo$in_repository)
1717
expect_equal(infos_not_in_repo$file, "R/my_mean.R")
1818
expect_true(is.na(infos_not_in_repo$first_modif))
19-
expect_equal(as.Date(infos_not_in_repo$last_modif), setNames(today, "last"))
19+
expect_equal(as.character(as.Date(infos_not_in_repo$last_modif)), setNames(today, "last"))
2020
})
2121

2222
# get_last_modif ----

0 commit comments

Comments
 (0)