Skip to content

Commit

Permalink
Add test cases for #107 (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
chainsawriot authored Jun 16, 2023
1 parent 73d0a8a commit 4fd44c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Binary file added tests/testdata/legend.rds
Binary file not shown.
7 changes: 7 additions & 0 deletions tests/testthat/test_write_ods_append_update.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,10 @@ test_that("Write Excel sheets", {
df <- read_ods(tmp, "SW10", row_names = TRUE, col_names = TRUE, strings_as_factors = TRUE)
expect_true(all.equal(starwars10[seq_len(nrow(starwars10)), 1, drop=FALSE], df))
})

test_that("issue 107", {
legend <- readRDS("../testdata/legend.rds")
expect_error(write_ods(legend, tmp, sheet = "Legend"), NA)
expect_error(write_ods(legend, tmp, sheet = "Legend", update = TRUE), NA)
expect_error(write_ods(legend, tmp, sheet = "Legend2", append = TRUE), NA)
})

0 comments on commit 4fd44c3

Please sign in to comment.