Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
mllg committed Aug 18, 2017
1 parent c7c3400 commit 1cd0457
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/testthat/test_JobCollection.R
Expand Up @@ -23,6 +23,20 @@ test_that("makeJobCollection", {
expect_output(print(jc), "Collection")
})


test_that("makeJobCollection does not expand relative paths", {
skip_on_os("windows")
reg = makeRegistry(file.dir = NA, make.default = FALSE)
batchMap(identity, 1, reg = reg)
reg$file.dir = "~/foo"
reg$work.dir = "~/bar"
jc = makeJobCollection(1, reg = reg)
expect_true(stri_startswith_fixed(jc$file.dir, "~/foo"))
expect_true(stri_startswith_fixed(jc$uri, "~/foo/jobs/"))
expect_true(stri_startswith_fixed(jc$log.file, "~/foo/logs"))
expect_true(stri_startswith_fixed(jc$work.dir, "~/bar"))
})

test_that("makeJobCollection.ExperimentCollection", {
reg = makeExperimentRegistry(file.dir = NA, make.default = FALSE)
addProblem(reg = reg, "p1", fun = function(job, data, ...) list(data = data, ...))
Expand Down

0 comments on commit 1cd0457

Please sign in to comment.