R Under development (unstable) (2024-09-28 r87201 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(testthat) > library(qs) qs 0.27.2. Announcement: https://github.com/qsbase/qs/issues/103 > > test_that("works as expected: defaults", { + + file = tempfile() + + x1 = iris + x2 = mtcars + + qsavem(x1, x2, file = file) + rm(x1, x2) + + qload(file = file) + expect_equal(x1, iris) + expect_equal(x2, mtcars) + + }) Test passed 🎊 > > test_that("works as expected: nthreads", { + + file = tempfile() + + x1 = iris + x2 = mtcars + + qsavem(x1, x2, file = file, nthreads=2) + rm(x1, x2) + + qload(file = file, nthreads=2) + expect_equal(x1, iris) + expect_equal(x2, mtcars) + + }) Test passed 😸 > > test_that("issue #39", { + + file = tempfile() + + seurat = 1 + lineages = 2 + T.markers = 3 + + qsavem(file = file, seurat, lineages, T.markers) + + rm(seurat, lineages, T.markers) + qload(file = file) + expect_equal(c(seurat, lineages, T.markers), c(1, 2, 3)) + + # alternate synatx + qsavem(seurat, lineages, T.markers, file = file) + + rm(seurat, lineages, T.markers) + qload(file = file) + expect_equal(c(seurat, lineages, T.markers), c(1, 2, 3)) + + # alternate synatx + qsavem(seurat, lineages, file = file, T.markers) + + rm(seurat, lineages, T.markers) + qload(file = file) + expect_equal(c(seurat, lineages, T.markers), c(1, 2, 3)) + + }) Test passed 😸 > > test_that("issue #46", { + test <- function() { + result_file <- tempfile() + test1 <- rnorm(100) + test2 <- rnorm(100) + qsavem(test1, test2, file = result_file) + } + test() + }) ── Skip: issue #46 ───────────────────────────────────────────────────────────── Reason: empty test > > proc.time() user system elapsed 1.68 0.79 2.42