Skip to content

Commit 4d38883

Browse files
committed
add 'test-multicore.R' for #1
1 parent f993bf3 commit 4d38883

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
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.033
3+
Version: 0.1.0.034
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

+1-1
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.033",
11+
"version": "0.1.0.034",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",

tests/testthat/test-multicore.R

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
test_that ("multicore", {
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+
res1 <- githist (path, num_cores = 1L)
7+
# Becuase of hard reset of history, entire pkg dir needs to be deleted and
8+
# re-created:
9+
fs::dir_delete (path)
10+
11+
flist <- unzip (pkg, exdir = fs::path_temp ())
12+
path <- fs::path_dir (flist [1])
13+
res2 <- githist (path, num_cores = 2L)
14+
fs::dir_delete (path)
15+
16+
expect_identical (res1, res2)
17+
})

0 commit comments

Comments
 (0)