@@ -43,11 +43,11 @@ my_test_that("Cache file is replaced if no lifespan is specified and recreate=TR
4343 mySimpleCache(" testDF" , instruction = { buildTestFrame() })
4444 expect_equal(1 , countCacheItems())
4545 expect_true(file_test(" -f" , fp ))
46- t0 = file.info(fp )$ ctime
46+ t0 = file.info(fp )$ mtime
4747 Sys.sleep(1 ) # Delay so that our time comparison can work.
4848 mySimpleCache(" testDF" , recreate = TRUE , instruction = { buildTestFrame() })
4949 expect_equal(1 , countCacheItems())
50- t1 = file.info(fp )$ ctime
50+ t1 = file.info(fp )$ mtime
5151 expect_true(t1 > t0 )
5252})
5353
@@ -59,10 +59,10 @@ my_test_that("Cache remains unchanged if younger than explicit lifespan", {
5959 mySimpleCache(" testDF" , instruction = { buildTestFrame() })
6060 expect_equal(1 , countCacheItems())
6161 expect_true(file_test(" -f" , fp ))
62- t0 = file.info(fp )$ ctime
62+ t0 = file.info(fp )$ mtime
6363 mySimpleCache(" testDF" , lifespan = 0.5 , instruction = { buildTestFrame() })
6464 expect_equal(1 , countCacheItems())
65- t1 = file.info(fp )$ ctime
65+ t1 = file.info(fp )$ mtime
6666 expect_true(t1 == t0 )
6767})
6868
@@ -74,11 +74,11 @@ my_test_that("Cache is replaced if older than explicit lifespan", {
7474 mySimpleCache(" testDF" , instruction = { buildTestFrame() })
7575 expect_equal(1 , countCacheItems())
7676 expect_true(file_test(" -f" , fp ))
77- t0 = file.info(fp )$ ctime
77+ t0 = file.info(fp )$ mtime
7878 Sys.sleep(1 ) # Time difference comparison reliability.
7979 mySimpleCache(" testDF" , lifespan = 0 , instruction = { buildTestFrame() })
8080 expect_equal(1 , countCacheItems())
81- t1 = file.info(fp )$ ctime
81+ t1 = file.info(fp )$ mtime
8282 expect_true(t1 > t0 )
8383})
8484
@@ -90,11 +90,11 @@ my_test_that("Cache is replaced if recreate=TRUE even if cache is fresh", {
9090 mySimpleCache(" testDF" , instruction = { buildTestFrame() })
9191 expect_true(file_test(" -f" , fp ))
9292 expect_equal(1 , countCacheItems())
93- t0 = file.info(fp )$ ctime
93+ t0 = file.info(fp )$ mtime
9494 Sys.sleep(1 ) # Time difference comparison reliability.
9595 mySimpleCache(" testDF" , recreate = TRUE , lifespan = 0 , instruction = { buildTestFrame() })
9696 expect_equal(1 , countCacheItems())
97- t1 = file.info(fp )$ ctime
97+ t1 = file.info(fp )$ mtime
9898 expect_true(t1 > t0 )
9999})
100100
@@ -104,10 +104,10 @@ my_test_that("simpleCache can pick up option specifying max cache age.", {
104104 expect_false(file_test(" -f" , fp ))
105105 mySimpleCache(" testDF" , instruction = { buildTestFrame() })
106106 expect_true(file_test(" -f" , fp ))
107- t0 = file.info(fp )$ ctime
107+ t0 = file.info(fp )$ mtime
108108 Sys.sleep(1 ) # Time difference comparison reliability.
109109 mySimpleCache(" testDF" , instruction = { buildTestFrame() })
110- t1 = file.info(fp )$ ctime
110+ t1 = file.info(fp )$ mtime
111111 expect_true(t1 > t0 )
112112})
113113
@@ -117,12 +117,12 @@ my_test_that("Direct lifespan specification is preferred to background option",
117117 expect_false(file_test(" -f" , fp ))
118118 mySimpleCache(" testDF" , instruction = { buildTestFrame() })
119119 expect_true(file_test(" -f" , fp ))
120- t0 = file.info(fp )$ ctime
120+ t0 = file.info(fp )$ mtime
121121 Sys.sleep(1 )
122122 mySimpleCache(" testDF" , instruction = { buildTestFrame() })
123123 expect_equal(t0 , file.info(fp )$ ctime ) # Cache is fresh via MAX.CACHE.AGE.
124124 Sys.sleep(1 ) # Time difference comparison reliability.
125125 mySimpleCache(" testDF" , lifespan = 0 , instruction = { buildTestFrame() })
126- t1 = file.info(fp )$ ctime
126+ t1 = file.info(fp )$ mtime
127127 expect_true(t1 > t0 ) # Cache is stale via lifespan.
128128})
0 commit comments