Skip to content

Commit

Permalink
loop over paths when setting mtime, because Sys.setFileTime was only …
Browse files Browse the repository at this point in the history
…vectorized in R 3.6.0
  • Loading branch information
Stefan Fleck committed Oct 22, 2020
1 parent e129fd0 commit eb2411f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/testthat/test_Cache.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ test_that("pruning works by number of files sorts by key if timestamp are identi
k3 <- cache$push(cars)
expect_identical(cache$n, 3L)

Sys.setFileTime(cache$files$path, "1999-01-01 00:00:00")
for (p in cache$files$path){ # loop necessary for compat with R < 3.6.0
Sys.setFileTime(p, "1999-01-01 00:00:00")
}

expect_identical(cache$files$key[[1]], k1)
expect_identical(cache$files$key[[2]], k2)
Expand Down

0 comments on commit eb2411f

Please sign in to comment.