From 1ee9d84cf42d6bb3580d1fe6643a7369c052f3c0 Mon Sep 17 00:00:00 2001 From: FelixErnst Date: Fri, 17 Jul 2020 21:55:26 +0200 Subject: [PATCH] fixed issue for pruning on R 3.6 Due to the automatic detection of the version pruning does have a result based on R version used. The test scenario changed is covert in R 3.6 by an earlier call, which is now fixed by testing with a condition. --- ChangeLog | 4 ++++ tests/skeleton_git2r.R | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2e794250..ee621e20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2020-07-17 FelixErnst + + * tests/skeleton_get2r.R: Fixed issue for pruning on r-oldrel + 2020-07-10 Dirk Eddelbuettel * DESCRIPTION (Version): Release 0.1.7 diff --git a/tests/skeleton_git2r.R b/tests/skeleton_git2r.R index d0ada71f..8f42f157 100644 --- a/tests/skeleton_git2r.R +++ b/tests/skeleton_git2r.R @@ -96,9 +96,16 @@ testRepoActions <- function(repodir){ # repoinfo <- drat::pruneRepo(repopath = repodir, remove = TRUE) # - repoinfo <- drat:::getRepoInfo(repopath = repodir, version = NA) - if(nrow(repoinfo) != 6L){ - stop("Wrong package files found after pruning for version = NA") + repoinfo <- drat:::getRepoInfo(repopath = repodir, version = NA, + type = c("source","binary")) + if(getRversion() < package_version("4.0")){ + if(nrow(repoinfo) != 4L){ + stop("Wrong package files found after pruning for version = NA") + } + } else { + if(nrow(repoinfo) != 6L){ + stop("Wrong package files found after pruning for version = NA") + } } repoinfo2 <- drat::pruneRepoForAllRversions(repopath = repodir, remove = TRUE) if(nrow(repoinfo2) != 4L){