Skip to content

Commit

Permalink
[covr] baseXML
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMarvin committed Jan 27, 2024
1 parent f794913 commit 623b4aa
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 21 deletions.
42 changes: 21 additions & 21 deletions R/baseXML.R
Original file line number Diff line number Diff line change
Expand Up @@ -189,28 +189,28 @@ genBaseWorkbook <- function() {
# workbookProtection

list(
fileVersion = NULL,
fileSharing = NULL,
workbookPr = '<workbookPr date1904="false"/>',
alternateContent = NULL,
revisionPtr = NULL,
absPath = NULL, # "x15ac:absPath"
workbookProtection = NULL,
bookViews = NULL,
sheets = NULL,
functionGroups = NULL,
externalReferences = NULL,
definedNames = NULL,
calcPr = NULL,
oleSize = NULL,
fileVersion = NULL,
fileSharing = NULL,
workbookPr = '<workbookPr date1904="false"/>',
alternateContent = NULL,
revisionPtr = NULL,
absPath = NULL, # "x15ac:absPath"
workbookProtection = NULL,
bookViews = NULL,
sheets = NULL,
functionGroups = NULL,
externalReferences = NULL,
definedNames = NULL,
calcPr = NULL,
oleSize = NULL,
customWorkbookViews = NULL,
pivotCaches = NULL,
smartTagPr = NULL,
smartTagTypes = NULL,
webPublishing = NULL,
fileRecoveryPr = NULL,
webPublishObjects = NULL,
extLst = NULL
pivotCaches = NULL,
smartTagPr = NULL,
smartTagTypes = NULL,
webPublishing = NULL,
fileRecoveryPr = NULL,
webPublishObjects = NULL,
extLst = NULL
)
}

Expand Down
17 changes: 17 additions & 0 deletions tests/testthat/test-class-workbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -941,3 +941,20 @@ test_that("wbWorkbook print works", {
expect_equal(exp, got)

})

test_that("genBaseWorkbook() works", {

# kinda superfluous. if it wouldn't work openxlsx2 would be broken

exp <- c(
"fileVersion", "fileSharing", "workbookPr", "alternateContent",
"revisionPtr", "absPath", "workbookProtection", "bookViews",
"sheets", "functionGroups", "externalReferences", "definedNames",
"calcPr", "oleSize", "customWorkbookViews", "pivotCaches", "smartTagPr",
"smartTagTypes", "webPublishing", "fileRecoveryPr", "webPublishObjects",
"extLst"
)
got <- names(genBaseWorkbook())
expect_equal(exp, got)

})

0 comments on commit 623b4aa

Please sign in to comment.