Skip to content

Commit b9e27de

Browse files
committed
extend tests for #11
1 parent c1fde80 commit b9e27de

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: githist
22
Title: Code analyses traced along the 'git' history of a package
3-
Version: 0.1.0.043
3+
Version: 0.1.0.044
44
Authors@R:
55
person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-2172-5265"))

codemeta.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"codeRepository": "https://github.com/ropensci-review-tools/githist",
99
"issueTracker": "https://github.com/ropensci-review-tools/githist/issues",
1010
"license": "https://spdx.org/licenses/GPL-3.0",
11-
"version": "0.1.0.43",
11+
"version": "0.1.0.044",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",
@@ -223,10 +223,13 @@
223223
"name": "pkgstats",
224224
"sameAs": "https://github.com/ropensci-review-tools/pkgstats"
225225
},
226-
"SystemRequirements": null
226+
"SystemRequirements": {}
227227
},
228228
"fileSize": "90.739KB",
229229
"readme": "https://github.com/ropensci-review-tools/githist/blob/main/README.md",
230-
"contIntegration": ["https://github.com/ropensci-review-tools/githist/actions?query=workflow%3AR-CMD-check", "https://app.codecov.io/gh/ropensci-review-tools/githist"],
230+
"contIntegration": [
231+
"https://github.com/ropensci-review-tools/githist/actions?query=workflow%3AR-CMD-check",
232+
"https://app.codecov.io/gh/ropensci-review-tools/githist"
233+
],
231234
"developmentStatus": "https://www.repostatus.org/#active"
232235
}

tests/testthat/test-chaoss-metrics-external.R

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
test_that ("chaoss external util fns", {
2+
pkg <- system.file ("extdata", "testpkg.zip", package = "githist")
3+
flist <- unzip (pkg, exdir = fs::path_temp ())
4+
path <- fs::path_dir (flist [1])
5+
6+
pkg_name <- pkg_name_from_path (path)
7+
expect_equal (pkg_name, "testpkg")
8+
9+
fs::dir_delete (path)
10+
})
11+
112
test_that ("chaoss external cran_downloads", {
213

314
pkg_name <- "goodpractice"

tests/testthat/test-testpkg.R

+9
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,13 @@ test_that ("githist parameters", {
4747
length (res2$desc_dat$date),
4848
length (unique (res2$desc_data$date))
4949
)
50+
51+
# Finally, test step_days > 1, which has no effect anyway, as all commits
52+
# are on same day
53+
flist <- unzip (pkg, exdir = fs::path_temp ())
54+
res3 <- githist (path, n = 2L, step_days = 2L, num_cores = 1L)
55+
fs::dir_delete (path)
56+
57+
n3 <- vapply (res3, nrow, integer (1L))
58+
expect_equal (n2, n3)
5059
})

0 commit comments

Comments
 (0)