File tree Expand file tree Collapse file tree 2 files changed +27
-18
lines changed Expand file tree Collapse file tree 2 files changed +27
-18
lines changed Original file line number Diff line number Diff line change 1+ test_that(" styler tests did not use R.cache in user root" , {
2+ skip_on_cran()
3+ skip_on_covr()
4+ skip_during_parallel()
5+ expect_true(
6+ length(list.files(R.cache :: getCachePath(" styler" ), recursive = TRUE )) == 0L
7+ )
8+ })
9+
10+ test_that(" clear Cache" , {
11+ # if R CMD CHECK is running, R.cache root is set to a temp
12+ # directory by default.
13+ # https://github.com/HenrikBengtsson/R.cache/commit/c7ac171f15f035674346d5504049c38cf07c268f
14+ # Hence, this clean up won't clean up the user directory that Ripley is
15+ # concerned about, but only some temp directory.
16+ # On the other hand, it seems completely unclear how the user cache even gets
17+ # populated.
18+ # skip_during_parallel()
19+ cache_path <- R.cache :: getCachePath(" styler" )
20+ R.cache :: clearCache(cache_path , recursive = TRUE , prompt = FALSE )
21+ # rlang::abort(paste0('cache path:', cache_path))
22+ skip_on_cran()
23+ skip_on_covr()
24+ expect_true(
25+ length(list.dirs(R.cache :: getCachePath(" styler" ))) == 1L
26+ )
27+ })
Original file line number Diff line number Diff line change 1- test_that(" styler tests did not use R.cache in user root" , {
2- skip_on_cran()
3- skip_on_covr()
4- expect_true(
5- length(list.files(R.cache :: getCachePath(" styler" ), recursive = TRUE )) == 0L
6- )
7- })
8-
9- test_that(" clear Cache" , {
10- R.cache :: clearCache(R.cache :: getCachePath(" styler" ), recursive = TRUE )
11- skip_on_cran()
12- skip_on_covr()
13- expect_true(
14- length(list.dirs(R.cache :: getCachePath(" styler" ))) == 1L
15- )
16- })
17-
18-
191test_that(" can delete empty cache directory" , {
202 skip_if(getRversion() < package_version(" 4.0.0" ))
213 skip_on_cran()
You can’t perform that action at this time.
0 commit comments