Skip to content

Commit

Permalink
cleanup test
Browse files Browse the repository at this point in the history
  • Loading branch information
achubaty committed Nov 7, 2018
1 parent b2fab80 commit 41437c3
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/testthat/test-cache.R
Expand Up @@ -155,7 +155,6 @@ test_that("test module-level cache", {

})


test_that("test .prepareOutput", {
testInitOut <- testInit("raster", smcc = FALSE)
on.exit({
Expand Down Expand Up @@ -189,13 +188,16 @@ test_that("test .prepareOutput", {
simCached2 <- spades(Copy(mySim), cache = TRUE, debug = FALSE)

if (interactive()) {
cat(file = "~/tmp/out.txt", names(params(mySim)$.progress), append = FALSE)
cat(file = "~/tmp/out.txt", "\n##############################\n", append = TRUE)
cat(file = "~/tmp/out.txt", names(params(simCached1)$.progress), append = TRUE)
cat(file = "~/tmp/out.txt", "\n##############################\n", append = TRUE)
cat(file = "~/tmp/out.txt", names(params(simCached2)$.progress), append = TRUE)
cat(file = "~/tmp/out.txt", "\n##############################\n", append = TRUE)
cat(file = "~/tmp/out.txt", all.equal(simCached1, simCached2), append = TRUE)
tmpDir <- "~/tmp"
testFile <- file.path(tmpDir, "test-cache-out.txt")
if (!dir.exists(tmpDir)) dir.create(tmpDir, recursive = TRUE)
cat(file = testFile, names(params(mySim)$.progress), append = FALSE)
cat(file = testFile, "\n##############################\n", append = TRUE)
cat(file = testFile, names(params(simCached1)$.progress), append = TRUE)
cat(file = testFile, "\n##############################\n", append = TRUE)
cat(file = testFile, names(params(simCached2)$.progress), append = TRUE)
cat(file = testFile, "\n##############################\n", append = TRUE)
cat(file = testFile, all.equal(simCached1, simCached2), append = TRUE)
}
expect_true(isTRUE(all.equal(simCached1, simCached2)))
})
Expand Down

0 comments on commit 41437c3

Please sign in to comment.