Skip to content

Commit

Permalink
test: add a test case for the memory_map option (#1120)
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi authored Jun 2, 2024
1 parent 172a480 commit aa549bf
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/testthat/test-ipc.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,22 @@ patrick::with_parameters_test_that("input/output DataFrame as raw vector",
compression = c("uncompressed", "lz4", "zstd"),
.test_name = compression
)


test_that("memory_map", {
tmpf = tempfile(fileext = ".arrow")
on.exit(unlink(tmpf))
pl$DataFrame(x = 1)$write_ipc(tmpf, compression = "uncompressed")

df = pl$read_ipc(tmpf, memory_map = TRUE)

expect_true(
df$equals(pl$DataFrame(x = 1))
)

pl$DataFrame(y = 2)$write_ipc(tmpf, compression = "uncompressed")

expect_true(
df$equals(pl$DataFrame(x = 2))
)
})

0 comments on commit aa549bf

Please sign in to comment.