Skip to content

Commit

Permalink
Add tests for zero row- and zero- column table reads
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusKlik committed Dec 5, 2023
1 parent b17bb47 commit 6f9ec28
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/testthat/test_special_tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ test_that("zero row multi-column table", {

# read-write cycle
write_fst(datatable, "testdata/zero_row.fst")
y <- read_fst("testdata/zero_row.fst")

x <- fst("testdata/zero_row.fst")
expect_equal(nrow(x), 0)

y <- read_fst("testdata/zero_row.fst")
expect_equal(datatable, y)
})

Expand All @@ -47,7 +50,11 @@ test_that("zero-column table", {

# read-write cycle
write_fst(data.frame(), "testdata/zero_column.fst")
y <- read_fst("testdata/zero_column.fst")

x <- fst("testdata/zero_column.fst")
expect_equal(ncol(x), 0)
expect_equal(nrow(x), 0)

y <- read_fst("testdata/zero_column.fst")
expect_equal(data.frame(), y)
})

0 comments on commit 6f9ec28

Please sign in to comment.