Skip to content

Commit

Permalink
extend tests for #11
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Nov 13, 2024
1 parent c1fde80 commit b9e27de
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: githist
Title: Code analyses traced along the 'git' history of a package
Version: 0.1.0.043
Version: 0.1.0.044
Authors@R:
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265"))
Expand Down
9 changes: 6 additions & 3 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"codeRepository": "https://github.com/ropensci-review-tools/githist",
"issueTracker": "https://github.com/ropensci-review-tools/githist/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.1.0.43",
"version": "0.1.0.044",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down Expand Up @@ -223,10 +223,13 @@
"name": "pkgstats",
"sameAs": "https://github.com/ropensci-review-tools/pkgstats"
},
"SystemRequirements": null
"SystemRequirements": {}
},
"fileSize": "90.739KB",
"readme": "https://github.com/ropensci-review-tools/githist/blob/main/README.md",
"contIntegration": ["https://github.com/ropensci-review-tools/githist/actions?query=workflow%3AR-CMD-check", "https://app.codecov.io/gh/ropensci-review-tools/githist"],
"contIntegration": [
"https://github.com/ropensci-review-tools/githist/actions?query=workflow%3AR-CMD-check",
"https://app.codecov.io/gh/ropensci-review-tools/githist"
],
"developmentStatus": "https://www.repostatus.org/#active"
}
11 changes: 11 additions & 0 deletions tests/testthat/test-chaoss-metrics-external.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
test_that ("chaoss external util fns", {
pkg <- system.file ("extdata", "testpkg.zip", package = "githist")
flist <- unzip (pkg, exdir = fs::path_temp ())
path <- fs::path_dir (flist [1])

pkg_name <- pkg_name_from_path (path)
expect_equal (pkg_name, "testpkg")

fs::dir_delete (path)
})

test_that ("chaoss external cran_downloads", {

pkg_name <- "goodpractice"
Expand Down
9 changes: 9 additions & 0 deletions tests/testthat/test-testpkg.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,13 @@ test_that ("githist parameters", {
length (res2$desc_dat$date),
length (unique (res2$desc_data$date))
)

# Finally, test step_days > 1, which has no effect anyway, as all commits
# are on same day
flist <- unzip (pkg, exdir = fs::path_temp ())
res3 <- githist (path, n = 2L, step_days = 2L, num_cores = 1L)
fs::dir_delete (path)

n3 <- vapply (res3, nrow, integer (1L))
expect_equal (n2, n3)
})

0 comments on commit b9e27de

Please sign in to comment.