Skip to content

Commit

Permalink
add 'test-multicore.R' for #1
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Nov 12, 2024
1 parent f993bf3 commit 4d38883
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 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.033
Version: 0.1.0.034
Authors@R:
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265"))
Expand Down
2 changes: 1 addition & 1 deletion 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.033",
"version": "0.1.0.034",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
17 changes: 17 additions & 0 deletions tests/testthat/test-multicore.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
test_that ("multicore", {
pkg <- system.file ("extdata", "testpkg.zip", package = "githist")
flist <- unzip (pkg, exdir = fs::path_temp ())
path <- fs::path_dir (flist [1])

res1 <- githist (path, num_cores = 1L)
# Becuase of hard reset of history, entire pkg dir needs to be deleted and
# re-created:
fs::dir_delete (path)

flist <- unzip (pkg, exdir = fs::path_temp ())
path <- fs::path_dir (flist [1])
res2 <- githist (path, num_cores = 2L)
fs::dir_delete (path)

expect_identical (res1, res2)
})

0 comments on commit 4d38883

Please sign in to comment.