Skip to content

Commit

Permalink
fix CRAN winbuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
mschubert committed Nov 11, 2017
1 parent 5e00cfc commit 79850a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/testthat/test-qsys.r
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
context("qsys")
skip_on_os("windows")

test_that("control flow", {
skip_on_os("windows")
fx = function(x) x*2
r = Q(fx, x=1:3, workers=workers(n_jobs=1, qsys_id="multicore", reuse=FALSE))
expect_equal(r, as.list(1:3*2))
})

test_that("common data", {
skip_on_os("windows")
fx = function(x, y) x*2 + y
r = Q(fx, x=1:3, const=list(y=10),
workers = workers(n_jobs=1, qsys_id="multicore", reuse=FALSE))
expect_equal(r, as.list(1:3*2+10))
})

test_that("export", {
skip_on_os("windows")
fx = function(x) x*2 + z
r = Q(fx, x=1:3, export=list(z=20),
workers = workers(n_jobs=1, qsys_id="multicore", reuse=FALSE))
expect_equal(r, as.list(1:3*2+20))
})

test_that("seed reproducibility", {
skip_on_os("windows")
fx = function(x) sample(1:100, 1)
r1 = Q(fx, x=1:3, workers=workers(n_jobs=1, qsys_id="multicore", reuse=FALSE))
r2 = Q(fx, x=1:3, workers=workers(n_jobs=1, qsys_id="multicore", reuse=FALSE))
expect_equal(r1, r2)
})

test_that("master does not exit loop prematurely", {
skip_on_os("windows")
fx = function(x) {
Sys.sleep(0.5)
x*2
Expand Down

0 comments on commit 79850a4

Please sign in to comment.