Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R/save] use dir.exist(). closes #263 #265

Merged
merged 7 commits into from
Aug 6, 2022
Merged

[R/save] use dir.exist(). closes #263 #265

merged 7 commits into from
Aug 6, 2022

Conversation

JanMarvin
Copy link
Owner

@JanMarvin JanMarvin commented Jul 8, 2022

"Forward-port" ycphs/openxlsx#364 from @christianrickert. Would be super nice, if you could check that this is still sufficient to fix your issue, @christianrickert (it's rather unlikely that I'll ever end up with your specific setup).

A basic command to write a file with openxlsx2 would be:

# remotes::install_github("JanMarvin/openxlsx2", ref = "gh_issue_263")
library(openxlsx2)
wb_workbook() %>% 
  wb_add_worksheet() %>% 
  wb_add_data(x = mtcars) %>% 
  wb_save("mtcars.xlsx")

[Edit:] added ref to remotes install.

@christianrickert
Copy link

Just ran the code with both versions (@head/@gh_issue_263) on my system.
The TEMP/TMP system variables are set to drive D:\ (USB stick).

From: @Head - expecting this to fail

> remotes::install_github("JanMarvin/openxlsx2")
Downloading GitHub repo JanMarvin/openxlsx2@HEADchecking for file 'D:\RtmpqSMLGY\remotes34a864c963cf\JanMarvin-openxlsx2-dce5801/DESCRIPTION' (11.1s)
─  preparing 'openxlsx2': (4m 56.5s)
✔  checking DESCRIPTION meta-information ...cleaning srcchecking for LF line-endings in source and make files and shell scripts (25.7s)
─  checking for empty or unneeded directories (10.7s)
─  building 'openxlsx2_0.2.1.9000.tar.gz'
   
* installing *source* package 'openxlsx2' ...
** using staged installation
** libs
[...]
installing to C:/Program Files/R/R-4.2.1/library/00LOCK-openxlsx2/00new/openxlsx2/libs/x64
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (openxlsx2)
> library(openxlsx2)

Attaching package:openxlsx2The following object is masked frompackage:readr:

    write_file

> wb_workbook() %>% 
+   wb_add_worksheet() %>% 
+   wb_add_data(x = mtcars) %>% 
+   wb_save("mtcars.xlsx")
Error in wb$clone()$save(path = path, overwrite = overwrite) : 
  Failed to create temporary directory 'D:\\RtmpqSMLGY\workbookTemp_34a83c0b173e'
In addition: Warning message:
In dir.create(path = tmpDir, recursive = TRUE) :
  cannot create dir 'D:\', reason 'Permission denied'
> 

From: @gh_issue_263 - testing for failure

> remotes::install_github("JanMarvin/openxlsx2", ref = "gh_issue_263")
Downloading GitHub repo JanMarvin/openxlsx2@gh_issue_263checking for file 'D:\RtmpY7UPwL\remotes3b6c11ad786d\JanMarvin-openxlsx2-e6ff5ae/DESCRIPTION' (10s)
─  preparing 'openxlsx2': (43.6s)
✔  checking DESCRIPTION meta-information ...cleaning srcchecking for LF line-endings in source and make files and shell scripts (22.2s)
─  checking for empty or unneeded directories (1.2s)
─  building 'openxlsx2_0.2.1.9000.tar.gz'
   
* installing *source* package 'openxlsx2' ...
** using staged installation
** libs
[...]
installing to C:/Program Files/R/R-4.2.1/library/00LOCK-openxlsx2/00new/openxlsx2/libs/x64
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures```

** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (openxlsx2)
> library(openxlsx2)
> wb_workbook() %>% 
+   wb_add_worksheet() %>% 
+   wb_add_data(x = mtcars) %>% 
+   wb_save("mtcars.xlsx")
Error in file(file.path(xlthemeDir, "theme1.xml"), open = "wb") : 
  cannot open the connection
In addition: Warning messages:
1: In dir.create(path, showWarnings = warn, recursive = recurse) :
  cannot create dir 'D:\', reason 'Permission denied'
2: In dir.create(path, showWarnings = warn, recursive = recurse) :
  cannot create dir 'D:\', reason 'Permission denied'
3: In dir.create(path, showWarnings = warn, recursive = recurse) :
  cannot create dir 'D:\', reason 'Permission denied'
4: In dir.create(path, showWarnings = warn, recursive = recurse) :
  cannot create dir 'D:\', reason 'Permission denied'
5: In dir.create(path, showWarnings = warn, recursive = recurse) :
  cannot create dir 'D:\', reason 'Permission denied'
6: In dir.create(path, showWarnings = warn, recursive = recurse) :
  cannot create dir 'D:\', reason 'Permission denied'
7: In dir.create(path, showWarnings = warn, recursive = recurse) :
  cannot create dir 'D:\', reason 'Permission denied'
8: In file(file.path(xlthemeDir, "theme1.xml"), open = "wb") :
  cannot open file 'D:\\RtmpY7UPwL\workbookTemp_3b6c66325311/xl/theme/theme1.xml': No such file or directory
> 

Same issues as before - is the recurse variable set to TRUE?

@JanMarvin
Copy link
Owner Author

Thanks for the follow up, it was TRUE indeed. Changed it to FALSE though unsure about the implications.

@christianrickert
Copy link

christianrickert commented Jul 13, 2022

It worked with the latest changes.

Here's the R console output from RStudio:

> tempdir()
[1] "D:\\\\RtmpGIwyET"
> library(openxlsx2)
> wb_workbook() %>% 
+   wb_add_worksheet() %>% 
+   wb_add_data(x = mtcars) %>% 
+   wb_save("mtcars.xlsx")
[1] "mtcars.xlsx"

Here's the output from the Microsoft Excel sheet:

mpg cyl disp hp drat wt qsec vs am gear carb
21 6 160 110 3.9 2.62 16.46 0 1 4 4
21 6 160 110 3.9 2.875 17.02 0 1 4 4
22.8 4 108 93 3.85 2.32 18.61 1 1 4 1
21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
18.7 8 360 175 3.15 3.44 17.02 0 0 3 2
18.1 6 225 105 2.76 3.46 20.22 1 0 3 1
14.3 8 360 245 3.21 3.57 15.84 0 0 3 4
24.4 4 146.7 62 3.69 3.19 20 1 0 4 2
22.8 4 140.8 95 3.92 3.15 22.9 1 0 4 2
19.2 6 167.6 123 3.92 3.44 18.3 1 0 4 4
17.8 6 167.6 123 3.92 3.44 18.9 1 0 4 4
16.4 8 275.8 180 3.07 4.07 17.4 0 0 3 3
17.3 8 275.8 180 3.07 3.73 17.6 0 0 3 3
15.2 8 275.8 180 3.07 3.78 18 0 0 3 3
10.4 8 472 205 2.93 5.25 17.98 0 0 3 4
10.4 8 460 215 3 5.424 17.82 0 0 3 4
14.7 8 440 230 3.23 5.345 17.42 0 0 3 4
32.4 4 78.7 66 4.08 2.2 19.47 1 1 4 1
30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2
33.9 4 71.1 65 4.22 1.835 19.9 1 1 4 1
21.5 4 120.1 97 3.7 2.465 20.01 1 0 3 1
15.5 8 318 150 2.76 3.52 16.87 0 0 3 2
15.2 8 304 150 3.15 3.435 17.3 0 0 3 2
13.3 8 350 245 3.73 3.84 15.41 0 0 3 4
19.2 8 400 175 3.08 3.845 17.05 0 0 3 2
27.3 4 79 66 4.08 1.935 18.9 1 1 4 1
26 4 120.3 91 4.43 2.14 16.7 0 1 5 2
30.4 4 95.1 113 3.77 1.513 16.9 1 1 5 2
15.8 8 351 264 4.22 3.17 14.5 0 1 5 4
19.7 6 145 175 3.62 2.77 15.5 0 1 5 6
15 8 301 335 3.54 3.57 14.6 0 1 5 8
21.4 4 121 109 4.11 2.78 18.6 1 1 4 2

Here's the output from the test_check("openxlsx2"):

> library(testthat)
> library(openxlsx2)
> library(rstudioapi)
> 
> # set path to current script directory
> setwd(dirname(getSourceEditorContext()$path))
> 
> test_check("openxlsx2")
Starting 2 test processes
[ FAIL 74 | WARN 5 | SKIP 1 | PASS 522 ]

══ Skipped tests ═══════════════════════════════════════════════════════════════════════════════════
• empty test (1)

══ Failed tests ════════════════════════════════════════════════════════════════════════════════════
── Error (test-class-comment.R:62:3): load comments ────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(fl) at test-class-comment.R:62:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_sources.R:5:3): read_xlsx from different sources ───────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::read_xlsx(xlsxFile) at test-read_sources.R:5:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_sources.R:29:3): wb_load from different sources ────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(xlsxFile) at test-read_sources.R:29:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_sources.R:44:3): get_date_origin from different sources ────
Error in `unzip(xlsxFile, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::get_date_origin(xlsxFile) at test-read_sources.R:44:2
 2.   └─utils::unzip(xlsxFile, exdir = xmlDir)
── Error (test-read_sources.R:60:3): read html source without r attribute on cell ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load("https://github.com/JanMarvin/openxlsx2/files/8702731/fichier_complementaire_ccam_descriptive_a_usage_pmsi_2021_v2.xlsx") at test-read_sources.R:60:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_sources.R:81:3): read <br> node in vml ─────────────────────
Error in `zip::unzip(temp_zip, exdir = temp_dir)`: zip error: `Cannot open zip file `D:\RtmpkZaPtU\file304c390c7bcc\macro2.xlsm.zip` for reading` in file `zip.c:136`
Backtrace:
    ▆
 1. └─zip::unzip(temp_zip, exdir = temp_dir) at test-read_sources.R:81:2
── Error (test-read_sources.R:94:3): encoding ──────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(fl) at test-read_sources.R:94:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-clean_sheet.R:4:3): clean_sheet ─────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(xlsx) at test-clean_sheet.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-cloneWorksheet.R:8:3): clone Worksheet with data ────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(file = file_name) at test-cloneWorksheet.R:8:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-cloneWorksheet.R:21:3): clone empty Worksheet ───────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(file = file_name) at test-cloneWorksheet.R:21:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:30:3): type = 'expression' work ────────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:
    ▆
 1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:30:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:173:3): type = 'duplicated' works ──────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:
    ▆
 1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:173:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:185:3): type = 'containsText' works ────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:
    ▆
 1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:185:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:205:3): type = 'notContainsText' works ──
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:
    ▆
 1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:205:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:224:3): type = 'beginsWith' works ──────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:
    ▆
 1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:224:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:237:3): type = 'endsWith' works ────────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:
    ▆
 1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:237:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:256:3): type = 'colorScale' works ──────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:
    ▆
 1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:256:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:280:3): type = 'databar' works ─────────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:
    ▆
 1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:280:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:292:3): type = 'between' works ─────────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:
    ▆
 1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:292:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:311:3): type = 'topN' works ────────────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:
    ▆
 1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:311:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:344:3): type = 'bottomN' works ─────────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:
    ▆
 1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:344:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:378:3): type as logical operators work ──
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:
    ▆
 1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:378:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:402:3): colorScale ─────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::read_xlsx(...) at test-conditional_formatting.R:402:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Failure (test-conditional_formatting.R:564:3): extend dataBar tests ─────────
`exp` (`actual`) not equal to `got` (`expected`).

lines(actual[[1]]) vs lines(expected[[1]])
- "<cfRule type=\"dataBar\" priority=\"6\"><dataBar showValue=\"1\"><cfvo type=\"min\"/><cfvo type=\"max\"/><color rgb=\"FF638EC6\"/></dataBar><extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40000}</x14:id></ext></extLst></cfRule>"
+ "<cfRule type=\"dataBar\" priority=\"6\"><dataBar showValue=\"1\">"
+ "                          <cfvo type=\"min\"/><cfvo type=\"max\"/>"
+ "                          <color rgb=\"FF638EC6\"/>"
+ "                          </dataBar>"
+ "                          <extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40000}</x14:id></ext>"
+ "                        </extLst></cfRule>"

lines(actual[[2]]) vs lines(expected[[2]])
- "<cfRule type=\"dataBar\" priority=\"5\"><dataBar showValue=\"0\"><cfvo type=\"min\"/><cfvo type=\"max\"/><color rgb=\"FF638EC6\"/></dataBar><extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40001}</x14:id></ext></extLst></cfRule>"
+ "<cfRule type=\"dataBar\" priority=\"5\"><dataBar showValue=\"0\">"
+ "                          <cfvo type=\"min\"/><cfvo type=\"max\"/>"
+ "                          <color rgb=\"FF638EC6\"/>"
+ "                          </dataBar>"
+ "                          <extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40001}</x14:id></ext>"
+ "                        </extLst></cfRule>"

lines(actual[[3]]) vs lines(expected[[3]])
- "<cfRule type=\"dataBar\" priority=\"4\"><dataBar showValue=\"0\"><cfvo type=\"min\"/><cfvo type=\"max\"/><color rgb=\"FFA6A6A6\"/></dataBar><extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40002}</x14:id></ext></extLst></cfRule>"
+ "<cfRule type=\"dataBar\" priority=\"4\"><dataBar showValue=\"0\">"
+ "                          <cfvo type=\"min\"/><cfvo type=\"max\"/>"
+ "                          <color rgb=\"FFA6A6A6\"/>"
+ "                          </dataBar>"
+ "                          <extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40002}</x14:id></ext>"
+ "                        </extLst></cfRule>"

lines(actual[[4]]) vs lines(expected[[4]])
- "<cfRule type=\"dataBar\" priority=\"3\"><dataBar showValue=\"1\"><cfvo type=\"min\"/><cfvo type=\"max\"/><color rgb=\"FFFF0000\"/></dataBar><extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40003}</x14:id></ext></extLst></cfRule>"
+ "<cfRule type=\"dataBar\" priority=\"3\"><dataBar showValue=\"1\">"
+ "                          <cfvo type=\"min\"/><cfvo type=\"max\"/>"
+ "                          <color rgb=\"FFFF0000\"/>"
+ "                          </dataBar>"
+ "                          <extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40003}</x14:id></ext>"
+ "                        </extLst></cfRule>"

lines(actual[[5]]) vs lines(expected[[5]])
- "<cfRule type=\"dataBar\" priority=\"2\"><dataBar showValue=\"1\"><cfvo type=\"min\"/><cfvo type=\"max\"/><color rgb=\"FFA6A6A6\"/></dataBar><extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40004}</x14:id></ext></extLst></cfRule>"
+ "<cfRule type=\"dataBar\" priority=\"2\"><dataBar showValue=\"1\">"
+ "                          <cfvo type=\"min\"/><cfvo type=\"max\"/>"
+ "                          <color rgb=\"FFA6A6A6\"/>"
+ "                          </dataBar>"
+ "                          <extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40004}</x14:id></ext>"
+ "                        </extLst></cfRule>"

lines(actual[[6]]) vs lines(expected[[6]])
- "<cfRule type=\"dataBar\" priority=\"1\"><dataBar showValue=\"1\"><cfvo type=\"num\" val=\"0\"/><cfvo type=\"num\" val=\"5\"/><color rgb=\"FFA6A6A6\"/></dataBar><extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40005}</x14:id></ext></extLst></cfRule>"
+ "<cfRule type=\"dataBar\" priority=\"1\"><dataBar showValue=\"1\">"
+ "                            <cfvo type=\"num\" val=\"0\"/><cfvo type=\"num\" val=\"5\"/>"
+ "                            <color rgb=\"FFA6A6A6\"/>"
+ "                            </dataBar>"
+ "                            <extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\">"
+ "                            <x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40005}</x14:id></ext></extLst></cfRule>"
── Failure (test-conditional_formatting.R:576:3): extend dataBar tests ─────────
`exp` (`actual`) not equal to `got` (`expected`).

lines(actual) vs lines(expected)
- "<ext uri=\"{78C0D931-6437-407d-A8EE-F0AAD7539E65}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\">"
- "                  <x14:conditionalFormattings>"
- "                  <x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\"><x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40000}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"1\" negativeBarBorderColorSameAsPositive=\"0\"><x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FF638EC6\"/><x14:negativeFillColor rgb=\"FFFF0000\"/><x14:negativeBorderColor rgb=\"FFFF0000\"/><x14:axisColor rgb=\"FF000000\"/></x14:dataBar></x14:cfRule><xm:sqref>A1:A11</xm:sqref></x14:conditionalFormatting>"
- "                  <x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\"><x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40001}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"0\" negativeBarBorderColorSameAsPositive=\"0\"><x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FF638EC6\"/><x14:negativeFillColor rgb=\"FFFF0000\"/><x14:negativeBorderColor rgb=\"FFFF0000\"/><x14:axisColor rgb=\"FF000000\"/></x14:dataBar></x14:cfRule><xm:sqref>C1:C11</xm:sqref></x14:conditionalFormatting>"
- "                  <x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\"><x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40002}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"1\" negativeBarBorderColorSameAsPositive=\"0\"><x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FFA6A6A6\"/><x14:negativeFillColor rgb=\"FFFF0000\"/><x14:negativeBorderColor rgb=\"FFFF0000\"/><x14:axisColor rgb=\"FF000000\"/></x14:dataBar></x14:cfRule><xm:sqref>E1:E11</xm:sqref></x14:conditionalFormatting>"
- "                  <x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\"><x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40003}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"0\" negativeBarBorderColorSameAsPositive=\"0\"><x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FFFF0000\"/><x14:negativeFillColor rgb=\"FFFF0000\"/><x14:negativeBorderColor rgb=\"FFFF0000\"/><x14:axisColor rgb=\"FF000000\"/></x14:dataBar></x14:cfRule><xm:sqref>G1:G11</xm:sqref></x14:conditionalFormatting>"
- "                  <x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\"><x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40004}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"0\" negativeBarBorderColorSameAsPositive=\"0\"><x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FFA6A6A6\"/><x14:negativeFillColor rgb=\"FFA6A6A6\"/><x14:negativeBorderColor rgb=\"FFA6A6A6\"/><x14:axisColor rgb=\"FF000000\"/></x14:dataBar></x14:cfRule><xm:sqref>I1:I11</xm:sqref></x14:conditionalFormatting>"
- "                  <x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\"><x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40005}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"0\" negativeBarBorderColorSameAsPositive=\"0\"><x14:cfvo type=\"num\"><xm:f>0</xm:f></x14:cfvo><x14:cfvo type=\"num\"><xm:f>5</xm:f></x14:cfvo><x14:borderColor rgb=\"FFA6A6A6\"/><x14:negativeFillColor rgb=\"FFA6A6A6\"/><x14:negativeBorderColor rgb=\"FFA6A6A6\"/><x14:axisColor rgb=\"FF000000\"/></x14:dataBar></x14:cfRule><xm:sqref>K1:K11</xm:sqref></x14:conditionalFormatting>"
- "                  </x14:conditionalFormattings></ext>"
+ "<ext uri=\"{78C0D931-6437-407d-A8EE-F0AAD7539E65}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:conditionalFormattings><x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\">"
+ "                      <x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40000}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"1\" negativeBarBorderColorSameAsPositive=\"0\">"
+ "                      <x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FF638EC6\"/><x14:negativeFillColor rgb=\"FFFF0000\"/><x14:negativeBorderColor rgb=\"FFFF0000\"/><x14:axisColor rgb=\"FF000000\"/>"
+ "                      </x14:dataBar></x14:cfRule><xm:sqref>A1:A11</xm:sqref></x14:conditionalFormatting><x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\">"
+ "                      <x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40001}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"0\" negativeBarBorderColorSameAsPositive=\"0\">"
+ "                      <x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FF638EC6\"/><x14:negativeFillColor rgb=\"FFFF0000\"/><x14:negativeBorderColor rgb=\"FFFF0000\"/><x14:axisColor rgb=\"FF000000\"/>"
+ "                      </x14:dataBar></x14:cfRule><xm:sqref>C1:C11</xm:sqref></x14:conditionalFormatting><x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\">"
+ "                      <x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40002}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"1\" negativeBarBorderColorSameAsPositive=\"0\">"
+ "                      <x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FFA6A6A6\"/><x14:negativeFillColor rgb=\"FFFF0000\"/><x14:negativeBorderColor rgb=\"FFFF0000\"/><x14:axisColor rgb=\"FF000000\"/>"
+ "                      </x14:dataBar></x14:cfRule><xm:sqref>E1:E11</xm:sqref></x14:conditionalFormatting><x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\">"
and 10 more ...
── Failure (test-conditional_formatting.R:595:3): wb_conditional_formatting ────
`exp` (`actual`) not equal to `got` (`expected`).

lines(actual) vs lines(expected)
- "<cfRule type=\"dataBar\" priority=\"1\"><dataBar showValue=\"1\"><cfvo type=\"min\"/><cfvo type=\"max\"/><color rgb=\"FF638EC6\"/></dataBar><extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40000}</x14:id></ext></extLst></cfRule>"
+ "<cfRule type=\"dataBar\" priority=\"1\"><dataBar showValue=\"1\">"
+ "                          <cfvo type=\"min\"/><cfvo type=\"max\"/>"
+ "                          <color rgb=\"FF638EC6\"/>"
+ "                          </dataBar>"
+ "                          <extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40000}</x14:id></ext>"
+ "                        </extLst></cfRule>"
── Error (test-class-workbook-wrappers.R:404:3): wb_clone_sheet_style() is a wrapper ──
Error in `get(method, wbWorkbook$public_methods)`: object 'clone_sheet_style' not found
Backtrace:
    ▆
 1. └─openxlsx2:::expect_wrapper(...) at test-class-workbook-wrappers.R:404:2
 2.   └─base::get(method, wbWorkbook$public_methods)
── Error (test-fill_merged_cells.R:19:3): fill merged cells ────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. ├─testthat::expect_equal(...) at test-fill_merged_cells.R:19:2
 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
 3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
 4. └─openxlsx2::read_xlsx(tmp_file, fillMergedCells = FALSE)
 5.   └─openxlsx2::wb_to_df(...)
 6.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 7.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-formulas.R:4:3): load various formulas ──────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(fl) at test-formulas.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-deleting_tables.R:128:3): Save and load Table Deletion ──────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(file = temp_file) at test-deleting_tables.R:128:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:4:3): Loading readTest.xlsx Sheet 1 ──────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(fl) at test-loading_workbook.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:16:3): Loading multiple pivot tables: loadPivotTables.xlsx works ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(fl) at test-loading_workbook.R:16:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:38:3): Load and saving a file with Threaded Comments works ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
     ▆
  1. ├─testthat::expect_silent(wb <- wb_load(fl)) at test-loading_workbook.R:38:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::wb_load(fl)
 10.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:47:3): Read and save file with inlineStr ─────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(fl) at test-loading_workbook.R:47:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:143:3): sheet visibility ─────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(fl) at test-loading_workbook.R:143:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:173:3): additional wb tests ──────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(xlsxFile) at test-loading_workbook.R:173:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:244:3): test headerFooter ────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(tmp1) at test-loading_workbook.R:244:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:259:3): load workbook with chartsheet ────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
     ▆
  1. ├─testthat::expect_silent(z <- wb_load(fl)) at test-loading_workbook.R:259:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::wb_load(fl)
 10.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook_tables.R:4:3): Tables loaded correctly ─────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(...) at test-loading_workbook_tables.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-helper_functions.R:92:3): ws_page_setup example ─────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(tmp) at test-helper_functions.R:92:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-helper_functions.R:111:3): amp_split & genHeaderFooterNode ──────
Error in `getHeaderFooterNode(xml)`: could not find function "getHeaderFooterNode"
── Error (test-names.R:20:3): names ────────────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(tmp) at test-names.R:20:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-protect-workbook.R:31:3): Reading protected Workbook ────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(file = temp_file) at test-protect-workbook.R:31:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-pugi_cpp.R:8:3): read_xml ───────────────────────────────────────
Error in `readXMLPtr(xml, isfile = FALSE, escapes = FALSE, declaration = FALSE, 
    whitespace = TRUE)`: unused argument (whitespace = TRUE)
Backtrace:
    ▆
 1. └─testthat::expect_silent(...) at test-pugi_cpp.R:8:2
 2.   └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
 3.     ├─testthat (local) .capture(...)
 4.     │ ├─withr::with_output_sink(...)
 5.     │ │ └─base::force(code)
 6.     │ ├─base::withCallingHandlers(...)
 7.     │ └─base::withVisible(code)
 8.     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
── Error (test-pugixml.R:11:3): read_xml ───────────────────────────────────────
Error in `read_xml(xml, whitespace = TRUE, pointer = FALSE)`: unused argument (whitespace = TRUE)
── Error (test-read_from_created_wb.R:84:3): Reading NAs and NaN values ────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. ├─testthat::expect_equal(read_xlsx(fileName), exp, ignore_attr = TRUE) at test-read_from_created_wb.R:84:2
 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
 3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
 4. └─openxlsx2::read_xlsx(fileName)
 5.   └─openxlsx2::wb_to_df(...)
 6.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 7.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:27:3): Maintaining Named Regions on Load ────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. ├─testthat::expect_equal(object = get_named_regions(wb), expected = get_named_regions(out_file)) at test-named_regions.R:27:2
 2. │ └─testthat::quasi_label(enquo(expected), expected.label, arg = "expected")
 3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
 4. └─openxlsx2::get_named_regions(out_file)
 5.   └─openxlsx2::wb_load(x)
 6.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:60:3): Correctly Loading Named Regions Created in Excel ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(filename) at test-named_regions.R:60:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:117:3): Load names from an Excel file with funky non-region names ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(filename) at test-named_regions.R:117:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:192:3): Missing rows in named regions ───────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::read_xlsx(...) at test-named_regions.R:192:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:265:3): Missing columns in named regions ────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::read_xlsx(...) at test-named_regions.R:265:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:307:3): Matching Substrings breaks reading named regions ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::get_named_regions(temp_file) at test-named_regions.R:307:2
 2.   └─openxlsx2::wb_load(x)
 3.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:334:3): Read namedRegion from specific sheet ────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::read_sheet_names(filename) at test-named_regions.R:334:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:410:5): deprecation test ────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. ├─testthat::expect_warning(...) at test-named_regions.R:410:4
 2. │ └─testthat:::expect_condition_matching(...)
 3. │   └─testthat:::quasi_capture(...)
 4. │     ├─testthat (local) .capture(...)
 5. │     │ └─base::withCallingHandlers(...)
 6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 7. └─openxlsx2::wb_to_df(filename, definedName = "MyRange")
 8.   └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 9.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_xlsx_correct_sheet.R:3:3): read_xlsx correct sheet ─────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::read_sheet_names(file = fl) at test-read_xlsx_correct_sheet.R:3:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_write_logicals.R:16:3): TRUE, FALSE, NA ────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::read_xlsx(fileName, sheet = 1, na.strings = "#N/A") at test-read_write_logicals.R:16:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_xlsx_random_seed.R:8:3): read_xlsx() does not change random seed ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::read_xlsx(tf) at test-read_xlsx_random_seed.R:8:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-remove_worksheets.R:29:3): Deleting worksheets ──────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(tempFile) at test-remove_worksheets.R:29:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:4:3): xf ───────────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:40:3): border ──────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:40:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:68:3): cellStyle ───────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:68:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:94:3): tableStyle ──────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:94:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:119:3): dxf ────────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:119:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:145:3): colors ─────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:145:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-wb_functions.R:6:3): wb_to_df ───────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
     ▆
  1. ├─testthat::expect_silent(wb1 <- wb_load(xlsxFile)) at test-wb_functions.R:6:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::wb_load(xlsxFile)
 10.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-wb_functions.R:133:3): select_active_sheet ──────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(...) at test-wb_functions.R:133:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-wb_styles.R:4:3): wb_clone_sheet_style ──────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(fl) at test-wb_styles.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-Workbook_properties.R:33:3): Workbook properties ────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(temp_file) at test-Workbook_properties.R:33:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-writeData.R:84:3): missing x is caught early [246] ──────────────
Error in `wb$.__enclos_env__$private$get_sheet_index(sheet)`: 'list' object cannot be coerced to type 'integer'
Backtrace:
     ▆
  1. ├─testthat::expect_error(wb_workbook()$add_data(mtcars), "`x` is missing") at test-writeData.R:84:2
  2. │ └─testthat:::expect_condition_matching(...)
  3. │   └─testthat:::quasi_capture(...)
  4. │     ├─testthat (local) .capture(...)
  5. │     │ └─base::withCallingHandlers(...)
  6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  7. └─wb_workbook()$add_data(mtcars)
  8.   └─openxlsx2::write_data(...)
  9.     └─openxlsx2:::write_data_table(...)
 10.       └─wb$.__enclos_env__$private$get_sheet_index(sheet)
── Error (test-writing_posixct.R:53:3): Writing mixed EDT/EST Posixct with write_data & write_datatable ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_to_df(xlsxFile, sheet = "write_data") at test-writing_posixct.R:53:2
 2.   └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 3.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-save.R:74:3): write_data2 ───────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. └─openxlsx2::wb_load(file) at test-save.R:74:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-save.R:188:3): writing NA, NaN and Inf ──────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. ├─base::unname(unlist(wb_to_df(tmp))) at test-save.R:188:2
 2. ├─base::unlist(wb_to_df(tmp))
 3. └─openxlsx2::wb_to_df(tmp)
 4.   └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 5.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-save.R:221:3): writing NA, NaN and Inf ──────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:
    ▆
 1. ├─base::unname(unlist(attr(wb_to_df(tmp, "Test1"), "tt"))) at test-save.R:221:2
 2. ├─base::unlist(attr(wb_to_df(tmp, "Test1"), "tt"))
 3. └─openxlsx2::wb_to_df(tmp, "Test1")
 4.   └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 5.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-save.R:248:3): write cells without data ─────────────────────────
Error in `write_data2(wb = wb, sheet = sheet, data = x, name = name, colNames = colNames, 
    rowNames = rowNames, startRow = startRow, startCol = startCol, 
    removeCellStyle = removeCellStyle, na.strings = na.strings)`: 'list' object cannot be coerced to type 'logical'
Backtrace:
    ▆
 1. └─wb_workbook()$add_worksheet()$add_data(...) at test-save.R:248:2
 2.   └─openxlsx2::write_data(...)
 3.     └─openxlsx2:::write_data_table(...)
 4.       └─openxlsx2::write_data2(...)

[ FAIL 74 | WARN 5 | SKIP 1 | PASS 522 ]
Error: Test failures

The implications depend on the need to actually create a folder structure during runtime recursively.
As far as I can tell, the recursive folder creation isn't used at all.
Instead, parent folders are explicitly created before creating their child folders.
Example:

private$preSaveCleanUp()

For example:

xlDir               <- dir_create(tmpDir, "xl")  # parent is created here
[...]
xlworksheetsDir     <- dir_create(tmpDir, "xl", "worksheets")  # child 1 is created here
xlworksheetsRelsDir <- dir_create(tmpDir, "xl", "worksheets", "_rels")  # child 2 is created here

@christianrickert
Copy link

I'm currently repeating the tests with openxlsx2@head.

@JanMarvin
Copy link
Owner Author

The implications depend on the need to actually create a folder structure during runtime recursively.
As far as I can tell, the recursive folder creation isn't used at all.
Instead, parent folders are explicitly created before creating their child folders.

Thanks for checking and testing! Yes, we only create folders explicitly. I thought that it works as mkdir -p and that we end up in a scenario, where we have to create the temp folder deep in some other folder. Though that's unlikely.

So we got saving working for us. The other failing tests might use some other resurse option, I haven't checked yet. At first glance I saw some errors regarding missing directories.

@christianrickert
Copy link

Thanks for checking and testing! Yes, we only create folders explicitly. I thought that it works as mkdir -p and that we end up in a scenario, where we have to create the temp folder deep in some other folder. Though that's unlikely.
Fair point.
So we got saving working for us. The other failing tests might use some other resurse option, I haven't checked yet. At first glance I saw some errors regarding missing directories.
It's actually a bit more complex after testing... 😅 I have tested both @head and @gh_issue_263 with drives C:\ (default %TEMP) and D:\ (at root).

# @head on C:\ (default %TEMP%)
> test_check("openxlsx2")
Starting 2 test processes
[ FAIL 0 | WARN 0 | SKIP 1 | PASS 897 ]

══ Skipped tests ══════════════════════════════════════════════════════════════════════════════════
• empty test (1)

[ FAIL 0 | WARN 0 | SKIP 1 | PASS 897 ]


# @gh_issue_263 on C:\ (default %TEMP%)
> test_check("openxlsx2")
Starting 2 test processes
[ FAIL 28 | WARN 0 | SKIP 1 | PASS 796 ]

══ Skipped tests ══════════════════════════════════════════════════════════════════════════════════
• empty test (1)

══ Failed tests ═══════════════════════════════════════════════════════════════════════════════════
── Error (test-class-workbook-wrappers.R:404:3): wb_clone_sheet_style() is a wrapper ──
Error in `get(method, wbWorkbook$public_methods)`: object 'clone_sheet_style' not found
Backtrace:1. └─openxlsx2:::expect_wrapper(...) at test-class-workbook-wrappers.R:404:2
 2.   └─base::get(method, wbWorkbook$public_methods)
── Error (test-conditional_formatting.R:30:3): type = 'expression' work ────────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:30:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:173:3): type = 'duplicated' works ──────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:173:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:185:3): type = 'containsText' works ────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:185:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:205:3): type = 'notContainsText' works ──
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:205:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:224:3): type = 'beginsWith' works ──────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:224:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:237:3): type = 'endsWith' works ────────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:237:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:256:3): type = 'colorScale' works ──────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:256:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:280:3): type = 'databar' works ─────────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:280:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:292:3): type = 'between' works ─────────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:292:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:311:3): type = 'topN' works ────────────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:311:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:344:3): type = 'bottomN' works ─────────
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:344:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Error (test-conditional_formatting.R:378:3): type as logical operators work ──
Error in `data.frame(typ = typ, id = id[length(id)], name = style_name[sty])`: arguments imply differing number of rows: 0, 1
Backtrace:1. └─openxlsx2 (local) my_workbook() at test-conditional_formatting.R:378:2
 2.   └─wb$styles_mgr$add(negStyle, "negStyle") at test-conditional_formatting.R:6:2
 3.     └─base::data.frame(typ = typ, id = id[length(id)], name = style_name[sty])
── Failure (test-conditional_formatting.R:417:3): colorScale ───────────────────
`exp` (`actual`) not identical to wb$worksheets[[1]]$conditionalFormatting (`expected`).

lines(actual) vs lines(expected)
- "<cfRule type=\"colorScale\" priority=\"1\"><colorScale><cfvo type=\"min\"/><cfvo type=\"max\"/><color rgb=\"FF000000\"/><color rgb=\"FFFFFFFF\"/></colorScale></cfRule>"
+ "<cfRule type=\"colorScale\" priority=\"1\"><colorScale>"
+ "                             <cfvo type=\"min\"/><cfvo type=\"max\"/>"
+ "                             <color rgb=\"FF000000\"/><color rgb=\"FFFFFFFF\"/>"
+ "                           </colorScale></cfRule>"
── Failure (test-conditional_formatting.R:436:3): colorScale ───────────────────
`exp` (`actual`) not identical to wb$worksheets[[2]]$conditionalFormatting (`expected`).

lines(actual) vs lines(expected)
- "<cfRule type=\"colorScale\" priority=\"1\"><colorScale><cfvo type=\"num\" val=\"1\"/><cfvo type=\"num\" val=\"255\"/><color rgb=\"FF0000FF\"/><color rgb=\"FFFF0000\"/></colorScale></cfRule>"
+ "<cfRule type=\"colorScale\" priority=\"1\"><colorScale>"
+ "                            <cfvo type=\"num\" val=\"1\"/><cfvo type=\"num\" val=\"255\"/>"
+ "                            <color rgb=\"FF0000FF\"/><color rgb=\"FFFF0000\"/>"
+ "                           </colorScale></cfRule>"
── Failure (test-conditional_formatting.R:454:3): colorScale ───────────────────
`exp` (`actual`) not identical to wb$worksheets[[3]]$conditionalFormatting (`expected`).

lines(actual) vs lines(expected)
- "<cfRule type=\"colorScale\" priority=\"1\"><colorScale><cfvo type=\"min\"/><cfvo type=\"percentile\" val=\"50\"/><cfvo type=\"max\"/><color rgb=\"FFFF0000\"/><color rgb=\"FF00FF00\"/><color rgb=\"FF0000FF\"/></colorScale></cfRule>"
+ "<cfRule type=\"colorScale\" priority=\"1\"><colorScale>"
+ "                             <cfvo type=\"min\"/><cfvo type=\"percentile\" val=\"50\"/><cfvo type=\"max\"/>"
+ "                             <color rgb=\"FFFF0000\"/><color rgb=\"FF00FF00\"/><color rgb=\"FF0000FF\"/>"
+ "                           </colorScale></cfRule>"
── Failure (test-conditional_formatting.R:476:3): colorScale ───────────────────
`exp` (`actual`) not identical to wb$worksheets[[4]]$conditionalFormatting (`expected`).

lines(actual) vs lines(expected)
- "<cfRule type=\"colorScale\" priority=\"1\"><colorScale><cfvo type=\"num\" val=\"1\"/><cfvo type=\"num\" val=\"155\"/><cfvo type=\"num\" val=\"255\"/><color rgb=\"FFFF0000\"/><color rgb=\"FF00FF00\"/><color rgb=\"FF0000FF\"/></colorScale></cfRule>"
+ "<cfRule type=\"colorScale\" priority=\"1\"><colorScale>"
+ "                            <cfvo type=\"num\" val=\"1\"/><cfvo type=\"num\" val=\"155\"/><cfvo type=\"num\" val=\"255\"/>"
+ "                            <color rgb=\"FFFF0000\"/><color rgb=\"FF00FF00\"/><color rgb=\"FF0000FF\"/>"
+ "                           </colorScale></cfRule>"
── Failure (test-conditional_formatting.R:564:3): extend dataBar tests ─────────
`exp` (`actual`) not equal to `got` (`expected`).

lines(actual[[1]]) vs lines(expected[[1]])
- "<cfRule type=\"dataBar\" priority=\"6\"><dataBar showValue=\"1\"><cfvo type=\"min\"/><cfvo type=\"max\"/><color rgb=\"FF638EC6\"/></dataBar><extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40000}</x14:id></ext></extLst></cfRule>"
+ "<cfRule type=\"dataBar\" priority=\"6\"><dataBar showValue=\"1\">"
+ "                          <cfvo type=\"min\"/><cfvo type=\"max\"/>"
+ "                          <color rgb=\"FF638EC6\"/>"
+ "                          </dataBar>"
+ "                          <extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40000}</x14:id></ext>"
+ "                        </extLst></cfRule>"

lines(actual[[2]]) vs lines(expected[[2]])
- "<cfRule type=\"dataBar\" priority=\"5\"><dataBar showValue=\"0\"><cfvo type=\"min\"/><cfvo type=\"max\"/><color rgb=\"FF638EC6\"/></dataBar><extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40001}</x14:id></ext></extLst></cfRule>"
+ "<cfRule type=\"dataBar\" priority=\"5\"><dataBar showValue=\"0\">"
+ "                          <cfvo type=\"min\"/><cfvo type=\"max\"/>"
+ "                          <color rgb=\"FF638EC6\"/>"
+ "                          </dataBar>"
+ "                          <extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40001}</x14:id></ext>"
+ "                        </extLst></cfRule>"

lines(actual[[3]]) vs lines(expected[[3]])
- "<cfRule type=\"dataBar\" priority=\"4\"><dataBar showValue=\"0\"><cfvo type=\"min\"/><cfvo type=\"max\"/><color rgb=\"FFA6A6A6\"/></dataBar><extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40002}</x14:id></ext></extLst></cfRule>"
+ "<cfRule type=\"dataBar\" priority=\"4\"><dataBar showValue=\"0\">"
+ "                          <cfvo type=\"min\"/><cfvo type=\"max\"/>"
+ "                          <color rgb=\"FFA6A6A6\"/>"
+ "                          </dataBar>"
+ "                          <extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40002}</x14:id></ext>"
+ "                        </extLst></cfRule>"

lines(actual[[4]]) vs lines(expected[[4]])
- "<cfRule type=\"dataBar\" priority=\"3\"><dataBar showValue=\"1\"><cfvo type=\"min\"/><cfvo type=\"max\"/><color rgb=\"FFFF0000\"/></dataBar><extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40003}</x14:id></ext></extLst></cfRule>"
+ "<cfRule type=\"dataBar\" priority=\"3\"><dataBar showValue=\"1\">"
+ "                          <cfvo type=\"min\"/><cfvo type=\"max\"/>"
+ "                          <color rgb=\"FFFF0000\"/>"
+ "                          </dataBar>"
+ "                          <extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40003}</x14:id></ext>"
+ "                        </extLst></cfRule>"

lines(actual[[5]]) vs lines(expected[[5]])
- "<cfRule type=\"dataBar\" priority=\"2\"><dataBar showValue=\"1\"><cfvo type=\"min\"/><cfvo type=\"max\"/><color rgb=\"FFA6A6A6\"/></dataBar><extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40004}</x14:id></ext></extLst></cfRule>"
+ "<cfRule type=\"dataBar\" priority=\"2\"><dataBar showValue=\"1\">"
+ "                          <cfvo type=\"min\"/><cfvo type=\"max\"/>"
+ "                          <color rgb=\"FFA6A6A6\"/>"
+ "                          </dataBar>"
+ "                          <extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40004}</x14:id></ext>"
+ "                        </extLst></cfRule>"

lines(actual[[6]]) vs lines(expected[[6]])
- "<cfRule type=\"dataBar\" priority=\"1\"><dataBar showValue=\"1\"><cfvo type=\"num\" val=\"0\"/><cfvo type=\"num\" val=\"5\"/><color rgb=\"FFA6A6A6\"/></dataBar><extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40005}</x14:id></ext></extLst></cfRule>"
+ "<cfRule type=\"dataBar\" priority=\"1\"><dataBar showValue=\"1\">"
+ "                            <cfvo type=\"num\" val=\"0\"/><cfvo type=\"num\" val=\"5\"/>"
+ "                            <color rgb=\"FFA6A6A6\"/>"
+ "                            </dataBar>"
+ "                            <extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\">"
+ "                            <x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40005}</x14:id></ext></extLst></cfRule>"
── Failure (test-conditional_formatting.R:576:3): extend dataBar tests ─────────
`exp` (`actual`) not equal to `got` (`expected`).

lines(actual) vs lines(expected)
- "<ext uri=\"{78C0D931-6437-407d-A8EE-F0AAD7539E65}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\">"
- "                  <x14:conditionalFormattings>"
- "                  <x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\"><x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40000}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"1\" negativeBarBorderColorSameAsPositive=\"0\"><x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FF638EC6\"/><x14:negativeFillColor rgb=\"FFFF0000\"/><x14:negativeBorderColor rgb=\"FFFF0000\"/><x14:axisColor rgb=\"FF000000\"/></x14:dataBar></x14:cfRule><xm:sqref>A1:A11</xm:sqref></x14:conditionalFormatting>"
- "                  <x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\"><x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40001}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"0\" negativeBarBorderColorSameAsPositive=\"0\"><x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FF638EC6\"/><x14:negativeFillColor rgb=\"FFFF0000\"/><x14:negativeBorderColor rgb=\"FFFF0000\"/><x14:axisColor rgb=\"FF000000\"/></x14:dataBar></x14:cfRule><xm:sqref>C1:C11</xm:sqref></x14:conditionalFormatting>"
- "                  <x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\"><x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40002}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"1\" negativeBarBorderColorSameAsPositive=\"0\"><x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FFA6A6A6\"/><x14:negativeFillColor rgb=\"FFFF0000\"/><x14:negativeBorderColor rgb=\"FFFF0000\"/><x14:axisColor rgb=\"FF000000\"/></x14:dataBar></x14:cfRule><xm:sqref>E1:E11</xm:sqref></x14:conditionalFormatting>"
- "                  <x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\"><x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40003}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"0\" negativeBarBorderColorSameAsPositive=\"0\"><x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FFFF0000\"/><x14:negativeFillColor rgb=\"FFFF0000\"/><x14:negativeBorderColor rgb=\"FFFF0000\"/><x14:axisColor rgb=\"FF000000\"/></x14:dataBar></x14:cfRule><xm:sqref>G1:G11</xm:sqref></x14:conditionalFormatting>"
- "                  <x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\"><x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40004}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"0\" negativeBarBorderColorSameAsPositive=\"0\"><x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FFA6A6A6\"/><x14:negativeFillColor rgb=\"FFA6A6A6\"/><x14:negativeBorderColor rgb=\"FFA6A6A6\"/><x14:axisColor rgb=\"FF000000\"/></x14:dataBar></x14:cfRule><xm:sqref>I1:I11</xm:sqref></x14:conditionalFormatting>"
- "                  <x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\"><x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40005}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"0\" negativeBarBorderColorSameAsPositive=\"0\"><x14:cfvo type=\"num\"><xm:f>0</xm:f></x14:cfvo><x14:cfvo type=\"num\"><xm:f>5</xm:f></x14:cfvo><x14:borderColor rgb=\"FFA6A6A6\"/><x14:negativeFillColor rgb=\"FFA6A6A6\"/><x14:negativeBorderColor rgb=\"FFA6A6A6\"/><x14:axisColor rgb=\"FF000000\"/></x14:dataBar></x14:cfRule><xm:sqref>K1:K11</xm:sqref></x14:conditionalFormatting>"
- "                  </x14:conditionalFormattings></ext>"
+ "<ext uri=\"{78C0D931-6437-407d-A8EE-F0AAD7539E65}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:conditionalFormattings><x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\">"
+ "                      <x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40000}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"1\" negativeBarBorderColorSameAsPositive=\"0\">"
+ "                      <x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FF638EC6\"/><x14:negativeFillColor rgb=\"FFFF0000\"/><x14:negativeBorderColor rgb=\"FFFF0000\"/><x14:axisColor rgb=\"FF000000\"/>"
+ "                      </x14:dataBar></x14:cfRule><xm:sqref>A1:A11</xm:sqref></x14:conditionalFormatting><x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\">"
+ "                      <x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40001}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"0\" negativeBarBorderColorSameAsPositive=\"0\">"
+ "                      <x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FF638EC6\"/><x14:negativeFillColor rgb=\"FFFF0000\"/><x14:negativeBorderColor rgb=\"FFFF0000\"/><x14:axisColor rgb=\"FF000000\"/>"
+ "                      </x14:dataBar></x14:cfRule><xm:sqref>C1:C11</xm:sqref></x14:conditionalFormatting><x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\">"
+ "                      <x14:cfRule type=\"dataBar\" id=\"{F7189283-14F7-4DE0-9601-54DE9DB40002}\"><x14:dataBar minLength=\"0\" maxLength=\"100\" border=\"1\" gradient=\"1\" negativeBarBorderColorSameAsPositive=\"0\">"
+ "                      <x14:cfvo type=\"autoMin\"/><x14:cfvo type=\"autoMax\"/><x14:borderColor rgb=\"FFA6A6A6\"/><x14:negativeFillColor rgb=\"FFFF0000\"/><x14:negativeBorderColor rgb=\"FFFF0000\"/><x14:axisColor rgb=\"FF000000\"/>"
+ "                      </x14:dataBar></x14:cfRule><xm:sqref>E1:E11</xm:sqref></x14:conditionalFormatting><x14:conditionalFormatting xmlns:xm=\"http://schemas.microsoft.com/office/excel/2006/main\">"
and 10 more ...
── Failure (test-conditional_formatting.R:595:3): wb_conditional_formatting ────
`exp` (`actual`) not equal to `got` (`expected`).

lines(actual) vs lines(expected)
- "<cfRule type=\"dataBar\" priority=\"1\"><dataBar showValue=\"1\"><cfvo type=\"min\"/><cfvo type=\"max\"/><color rgb=\"FF638EC6\"/></dataBar><extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40000}</x14:id></ext></extLst></cfRule>"
+ "<cfRule type=\"dataBar\" priority=\"1\"><dataBar showValue=\"1\">"
+ "                          <cfvo type=\"min\"/><cfvo type=\"max\"/>"
+ "                          <color rgb=\"FF638EC6\"/>"
+ "                          </dataBar>"
+ "                          <extLst><ext uri=\"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\"><x14:id>{F7189283-14F7-4DE0-9601-54DE9DB40000}</x14:id></ext>"
+ "                        </extLst></cfRule>"
── Failure (test-read_sources.R:130:3): encoding ───────────────────────────────
`exp` (`actual`) not equal to `got` (`expected`).

    lines(actual)    | lines(expected)    
[1] "<xml>"          | "<xml>"         [1]
[2] " <a0>äöüß</a0>" - "<a0>äöüß</a0>" [2]
[3] " <A0>ÄÖÜ</A0>"  - "<A0>ÄÖÜ</A0>"  [3]
[4] " <a1>€</a1>"    - "<a1>€</a1>"    [4]
[5] "</xml>"         | "</xml>"        [5]
── Failure (test-read_sources.R:135:3): encoding ───────────────────────────────
`exp` (`actual`) not equal to `got` (`expected`).

    lines(actual)                                    | lines(expected)    
[1] "<xml><a0>äöüß</a0><A0>ÄÖÜ</A0><a1>€</a1></xml>" - "<xml>"         [1]
                                                     - "<a0>äöüß</a0>" [2]
                                                     - "<A0>ÄÖÜ</A0>"  [3]
                                                     - "<a1>€</a1>"    [4]
                                                     - "</xml>"        [5]
── Error (test-helper_functions.R:111:3): amp_split & genHeaderFooterNode ──────
Error in `getHeaderFooterNode(xml)`: could not find function "getHeaderFooterNode"
── Error (test-pugi_cpp.R:8:3): read_xml ───────────────────────────────────────
Error in `readXMLPtr(xml, isfile = FALSE, escapes = FALSE, declaration = FALSE, 
    whitespace = TRUE)`: unused argument (whitespace = TRUE)
Backtrace:1. └─testthat::expect_silent(...) at test-pugi_cpp.R:8:2
 2.   └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
 3.     ├─testthat (local) .capture(...)
 4.     │ ├─withr::with_output_sink(...)
 5.     │ │ └─base::force(code)
 6.     │ ├─base::withCallingHandlers(...)
 7.     │ └─base::withVisible(code)
 8.     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
── Error (test-pugixml.R:11:3): read_xml ───────────────────────────────────────
Error in `read_xml(xml, whitespace = TRUE, pointer = FALSE)`: unused argument (whitespace = TRUE)
── Error (test-save.R:248:3): write cells without data ─────────────────────────
Error in `write_data2(wb = wb, sheet = sheet, data = x, name = name, colNames = colNames, 
    rowNames = rowNames, startRow = startRow, startCol = startCol, 
    removeCellStyle = removeCellStyle, na.strings = na.strings)`: 'list' object cannot be coerced to type 'logical'
Backtrace:1. └─wb_workbook()$add_worksheet()$add_data(...) at test-save.R:248:2
 2.   └─openxlsx2::write_data(...)
 3.     └─openxlsx2:::write_data_table(...)
 4.       └─openxlsx2::write_data2(...)
── Error (test-wb_styles.R:6:3): wb_clone_sheet_style ──────────────────────────
Error in `wb_clone_sheet_style(wb, "SUM", "clone")`: could not find function "wb_clone_sheet_style"
── Error (test-writeData.R:84:3): missing x is caught early [246] ──────────────
Error in `wb$.__enclos_env__$private$get_sheet_index(sheet)`: 'list' object cannot be coerced to type 'integer'
Backtrace:1. ├─testthat::expect_error(wb_workbook()$add_data(mtcars), "`x` is missing") at test-writeData.R:84:2
  2. │ └─testthat:::expect_condition_matching(...)
  3. │   └─testthat:::quasi_capture(...)
  4. │     ├─testthat (local) .capture(...)
  5. │     │ └─base::withCallingHandlers(...)
  6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  7. └─wb_workbook()$add_data(mtcars)
  8.   └─openxlsx2::write_data(...)
  9.     └─openxlsx2:::write_data_table(...)
 10.       └─wb$.__enclos_env__$private$get_sheet_index(sheet)

[ FAIL 28 | WARN 0 | SKIP 1 | PASS 796 ]
Error: Test failures


# @head on D:\ (at root)
> library(openxlsx2)
> library(testthat)
> library(openxlsx2)
> library(rstudioapi)
> 
> # set path to current script directory
> setwd(dirname(getSourceEditorContext()$path))
> 
> test_check("openxlsx2")
Starting 2 test processes
[ FAIL 75 | WARN 26 | SKIP 1 | PASS 496 ]

══ Skipped tests ═══════════════════════════════════════════════════════════════════════════════════
• empty test (1)

══ Failed tests ════════════════════════════════════════════════════════════════════════════════════
── Error (test-class-comment.R:54:3): comments ─────────────────────────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpmkbSgz\workbookTemp_301c33a36bbd'
Backtrace:1. ├─testthat::expect_silent(wb_save(wb, tmp)) at test-class-comment.R:54:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::wb_save(wb, tmp)
 10.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-class-comment.R:62:3): load comments ────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-class-comment.R:62:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_sources.R:5:3): read_xlsx from different sources ───────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::read_xlsx(xlsxFile) at test-read_sources.R:5:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_sources.R:29:3): wb_load from different sources ────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-read_sources.R:29:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_sources.R:44:3): get_date_origin from different sources ────
Error in `unzip(xlsxFile, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::get_date_origin(xlsxFile) at test-read_sources.R:44:2
 2.   └─utils::unzip(xlsxFile, exdir = xmlDir)
── Error (test-read_sources.R:60:3): read html source without r attribute on cell ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load("https://github.com/JanMarvin/openxlsx2/files/8702731/fichier_complementaire_ccam_descriptive_a_usage_pmsi_2021_v2.xlsx") at test-read_sources.R:60:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_sources.R:81:3): read <br> node in vml ─────────────────────
Error in `zip::unzip(temp_zip, exdir = temp_dir)`: zip error: `Cannot open zip file `D:\RtmpUr33u7\file22d027667ebd\macro2.xlsm.zip` for reading` in file `zip.c:136`
Backtrace:1. └─zip::unzip(temp_zip, exdir = temp_dir) at test-read_sources.R:81:2
── Error (test-read_sources.R:94:3): encoding ──────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-read_sources.R:94:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-clean_sheet.R:4:3): clean_sheet ─────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsx) at test-clean_sheet.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-cloneWorksheet.R:8:3): clone Worksheet with data ────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(file = file_name) at test-cloneWorksheet.R:8:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-cloneWorksheet.R:21:3): clone empty Worksheet ───────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(file = file_name) at test-cloneWorksheet.R:21:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:169:3): type = 'expression' work ───────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d0297e24fb'
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:169:2
  2.   ├─testthat::expect_silent(wb_save(wb, path)) at test-conditional_formatting.R:17:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_save(wb, path)
 11.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-conditional_formatting.R:181:3): type = 'duplicated' works ──────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d087d5c48'
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:181:2
  2.   ├─testthat::expect_silent(wb_save(wb, path)) at test-conditional_formatting.R:17:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_save(wb, path)
 11.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-conditional_formatting.R:201:3): type = 'containsText' works ────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d0393641d'
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:201:2
  2.   ├─testthat::expect_silent(wb_save(wb, path)) at test-conditional_formatting.R:17:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_save(wb, path)
 11.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-conditional_formatting.R:220:3): type = 'notContainsText' works ──
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d010a01854'
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:220:2
  2.   ├─testthat::expect_silent(wb_save(wb, path)) at test-conditional_formatting.R:17:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_save(wb, path)
 11.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-conditional_formatting.R:233:3): type = 'beginsWith' works ──────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d071172af7'
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:233:2
  2.   ├─testthat::expect_silent(wb_save(wb, path)) at test-conditional_formatting.R:17:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_save(wb, path)
 11.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-conditional_formatting.R:252:3): type = 'endsWith' works ────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d06cda58c8'
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:252:2
  2.   ├─testthat::expect_silent(wb_save(wb, path)) at test-conditional_formatting.R:17:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_save(wb, path)
 11.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-conditional_formatting.R:259:3): type = 'colorScale' works ──────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::read_xlsx(...) at test-conditional_formatting.R:259:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:288:3): type = 'databar' works ─────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d0788edb9'
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:288:2
  2.   ├─testthat::expect_silent(wb_save(wb, path)) at test-conditional_formatting.R:17:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_save(wb, path)
 11.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-conditional_formatting.R:307:3): type = 'between' works ─────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d02dba1975'
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:307:2
  2.   ├─testthat::expect_silent(wb_save(wb, path)) at test-conditional_formatting.R:17:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_save(wb, path)
 11.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-conditional_formatting.R:340:3): type = 'topN' works ────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d060fb1fdb'
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:340:2
  2.   ├─testthat::expect_silent(wb_save(wb, path)) at test-conditional_formatting.R:17:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_save(wb, path)
 11.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-conditional_formatting.R:374:3): type = 'bottomN' works ─────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d02a0e4afe'
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:374:2
  2.   ├─testthat::expect_silent(wb_save(wb, path)) at test-conditional_formatting.R:17:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_save(wb, path)
 11.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-conditional_formatting.R:392:3): type as logical operators work ──
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d08ed1669'
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:392:2
  2.   ├─testthat::expect_silent(wb_save(wb, path)) at test-conditional_formatting.R:17:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_save(wb, path)
 11.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-conditional_formatting.R:402:3): colorScale ─────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::read_xlsx(...) at test-conditional_formatting.R:402:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-deleting_tables.R:81:3): Deleting a Table Object ────────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d053953cf9'
Backtrace:1. └─openxlsx2::wb_save(wb, temp) at test-deleting_tables.R:81:2
 2.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-deleting_tables.R:127:3): Save and load Table Deletion ──────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d052a51fe5'
Backtrace:1. └─openxlsx2::wb_save(wb, temp_file) at test-deleting_tables.R:127:2
 2.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-fill_merged_cells.R:16:3): fill merged cells ────────────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d01820307c'
Backtrace:1. └─openxlsx2::wb_save(wb, tmp_file) at test-fill_merged_cells.R:16:2
 2.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-formulas.R:4:3): load various formulas ──────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-formulas.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-helper_functions.R:89:3): ws_page_setup example ─────────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d03c5d7d16'
Backtrace:1. ├─testthat::expect_silent(wb_save(wb, tmp, overwrite = TRUE)) at test-helper_functions.R:89:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::wb_save(wb, tmp, overwrite = TRUE)
 10.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-loading_workbook.R:4:3): Loading readTest.xlsx Sheet 1 ──────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-loading_workbook.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:16:3): Loading multiple pivot tables: loadPivotTables.xlsx works ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-loading_workbook.R:16:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:38:3): Load and saving a file with Threaded Comments works ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. ├─testthat::expect_silent(wb <- wb_load(fl)) at test-loading_workbook.R:38:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::wb_load(fl)
 10.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:47:3): Read and save file with inlineStr ─────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-loading_workbook.R:47:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:143:3): sheet visibility ─────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-loading_workbook.R:143:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:173:3): additional wb tests ──────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-loading_workbook.R:173:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:242:3): test headerFooter ────────────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d02aee118a'
Backtrace:1. └─openxlsx2::wb_save(wb, tmp1, overwrite = TRUE) at test-loading_workbook.R:242:2
 2.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-loading_workbook.R:259:3): load workbook with chartsheet ────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. ├─testthat::expect_silent(z <- wb_load(fl)) at test-loading_workbook.R:259:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::wb_load(fl)
 10.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook_tables.R:4:3): Tables loaded correctly ─────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(...) at test-loading_workbook_tables.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Failure (test-names.R:18:3): names ──────────────────────────────────────────
`wb_save(wb, tmp)` threw an unexpected error.
Message: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d021176459'
Class:   simpleError/error/condition
Backtrace:1. ├─testthat::expect_error(wb_save(wb, tmp), NA) at test-names.R:18:2
 2. │ └─testthat:::expect_condition_matching(...)
 3. │   └─testthat:::quasi_capture(...)
 4. │     ├─testthat (local) .capture(...)
 5. │     │ └─base::withCallingHandlers(...)
 6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 7. └─openxlsx2::wb_save(wb, tmp)
 8.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-names.R:20:3): names ────────────────────────────────────────────
Error in `wb_load(tmp)`: File does not exist.
Backtrace:1. └─openxlsx2::wb_load(tmp) at test-names.R:20:2
── Error (test-protect-workbook.R:29:3): Reading protected Workbook ────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d06b065b0f'
Backtrace:1. └─openxlsx2::wb_save(wb, temp_file) at test-protect-workbook.R:29:2
 2.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-named_regions.R:25:3): Maintaining Named Regions on Load ────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpmkbSgz\workbookTemp_301c68a91c62'
Backtrace:1. └─openxlsx2::wb_save(wb, out_file, overwrite = TRUE) at test-named_regions.R:25:2
 2.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-named_regions.R:60:3): Correctly Loading Named Regions Created in Excel ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(filename) at test-named_regions.R:60:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:117:3): Load names from an Excel file with funky non-region names ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(filename) at test-named_regions.R:117:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:189:3): Missing rows in named regions ───────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpmkbSgz\workbookTemp_301c27a110a6'
Backtrace:1. └─openxlsx2::wb_save(wb, temp_file) at test-named_regions.R:189:2
 2.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-named_regions.R:262:3): Missing columns in named regions ────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpmkbSgz\workbookTemp_301cb216e4b'
Backtrace:1. └─openxlsx2::wb_save(wb, temp_file) at test-named_regions.R:262:2
 2.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-named_regions.R:300:3): Matching Substrings breaks reading named regions ──
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpmkbSgz\workbookTemp_301c31eb541a'
Backtrace:1. └─openxlsx2::wb_save(wb, temp_file) at test-named_regions.R:300:2
 2.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-named_regions.R:334:3): Read namedRegion from specific sheet ────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::read_sheet_names(filename) at test-named_regions.R:334:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:410:5): deprecation test ────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. ├─testthat::expect_warning(...) at test-named_regions.R:410:4
 2. │ └─testthat:::expect_condition_matching(...)
 3. │   └─testthat:::quasi_capture(...)
 4. │     ├─testthat (local) .capture(...)
 5. │     │ └─base::withCallingHandlers(...)
 6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 7. └─openxlsx2::wb_to_df(filename, definedName = "MyRange")
 8.   └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 9.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_write_logicals.R:14:3): TRUE, FALSE, NA ────────────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpmkbSgz\workbookTemp_301c252d4db3'
Backtrace:1. └─openxlsx2::write_xlsx(x, file = fileName, colNames = TRUE) at test-read_write_logicals.R:14:2
 2.   └─openxlsx2::wb_save(wb, path = file, overwrite = overwrite)
 3.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-read_from_created_wb.R:74:3): Reading NAs and NaN values ────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d05a8c44e8'
Backtrace:1. └─openxlsx2::wb_save(wb, path = fileName, overwrite = TRUE) at test-read_from_created_wb.R:74:2
 2.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-read_xlsx_correct_sheet.R:3:3): read_xlsx correct sheet ─────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::read_sheet_names(file = fl) at test-read_xlsx_correct_sheet.R:3:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_xlsx_random_seed.R:6:3): read_xlsx() does not change random seed ──
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d076d14169'
Backtrace:1. └─openxlsx2::write_xlsx(data.frame(a = 1), tf) at test-read_xlsx_random_seed.R:6:2
 2.   └─openxlsx2::wb_save(wb, path = file, overwrite = overwrite)
 3.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-remove_worksheets.R:25:3): Deleting worksheets ──────────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpmkbSgz\workbookTemp_301c45d4fcb'
Backtrace:1. └─openxlsx2::wb_save(wb, tempFile, overwrite = TRUE) at test-remove_worksheets.R:25:2
 2.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-styles_xml.R:4:3): xf ───────────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:40:3): border ──────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:40:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:68:3): cellStyle ───────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:68:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:94:3): tableStyle ──────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:94:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:119:3): dxf ────────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:119:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:145:3): colors ─────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:145:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-save.R:4:3): test return values for wb_save ─────────────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d057b842fc'
Backtrace:1. ├─testthat::expect_identical(tempFile, wb_save(wb, tempFile)) at test-save.R:4:2
 2. │ └─testthat::quasi_label(enquo(expected), expected.label, arg = "expected")
 3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
 4. └─openxlsx2::wb_save(wb, tempFile)
 5.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-save.R:20:3): regression test for #248 ──────────────────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d01aed7a71'
Backtrace:1. ├─testthat::expect_silent(...) at test-save.R:20:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::write_xlsx(df, tempFile, borders = "columns", overwrite = TRUE)
 10.   └─openxlsx2::wb_save(wb, path = file, overwrite = overwrite)
 11.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-save.R:49:3): creating hyperlinks ───────────────────────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d0549d5f82'
Backtrace:1. ├─testthat::expect_silent(wb_save(wb, tempFile, overwrite = TRUE)) at test-save.R:49:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::wb_save(wb, tempFile, overwrite = TRUE)
 10.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-save.R:72:3): write_data2 ───────────────────────────────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d0439a455e'
Backtrace:1. └─openxlsx2::wb_save(wb, file) at test-save.R:72:2
 2.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-save.R:104:3): write xlsx ───────────────────────────────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d06bb55c3f'
Backtrace:1. ├─testthat::expect_silent(write_xlsx(df, tmp, tabColour = "#4F81BD")) at test-save.R:104:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::write_xlsx(df, tmp, tabColour = "#4F81BD")
 10.   └─openxlsx2::wb_save(wb, path = file, overwrite = overwrite)
 11.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-save.R:153:3): example ──────────────────────────────────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d05c77715c'
Backtrace:1. ├─testthat::expect_silent(write_xlsx(iris, file = tmp, colNames = TRUE)) at test-save.R:153:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::write_xlsx(iris, file = tmp, colNames = TRUE)
 10.   └─openxlsx2::wb_save(wb, path = file, overwrite = overwrite)
 11.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-save.R:184:3): writing NA, NaN and Inf ──────────────────────────
Error in `wb$add_worksheet("Test1")$add_data(x = x)$save(tmp)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d036c62a18'
Backtrace:1. └─wb$add_worksheet("Test1")$add_data(x = x)$save(tmp) at test-save.R:184:2
── Error (test-save.R:216:3): writing NA, NaN and Inf ──────────────────────────
Error in `wb$add_worksheet("Test1")$add_data(x = x, na.strings = NULL)$save(tmp)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d0182a4ac6'
Backtrace:1. └─wb$add_worksheet("Test1")$add_data(x = x, na.strings = NULL)$save(tmp) at test-save.R:216:2
── Error (test-save.R:258:3): write cells without data ─────────────────────────
Error in `wb$save(temp)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d038977dec'
Backtrace:1. └─wb$save(temp) at test-save.R:258:2
── Error (test-wb_functions.R:6:3): wb_to_df ───────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. ├─testthat::expect_silent(wb1 <- wb_load(xlsxFile)) at test-wb_functions.R:6:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::wb_load(xlsxFile)
 10.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-wb_functions.R:133:3): select_active_sheet ──────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(...) at test-wb_functions.R:133:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-wb_styles.R:4:3): wb_clone_sheet_style ──────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-wb_styles.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-Workbook_properties.R:18:3): Workbook properties ────────────────
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d05ba434ff'
Backtrace:1. └─openxlsx2::write_xlsx(...) at test-Workbook_properties.R:18:2
 2.   └─openxlsx2::wb_save(wb, path = file, overwrite = overwrite)
 3.     └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-writing_posixct.R:51:3): Writing mixed EDT/EST Posixct with write_data & write_datatable ──
Error in `wb$clone()$save(path = path, overwrite = overwrite)`: Failed to create temporary directory 'D:\\RtmpmkbSgz\workbookTemp_301c6ed01225'
Backtrace:1. └─openxlsx2::wb_save(wb, xlsxFile, TRUE) at test-writing_posixct.R:51:2
 2.   └─wb$clone()$save(path = path, overwrite = overwrite)
── Error (test-xl_open.R:4:3): xl_open() works ─────────────────────────────────
Error in `x$clone()$save(temp_xlsx(macros = has_macros))`: Failed to create temporary directory 'D:\\RtmpUr33u7\workbookTemp_22d0429599f'
Backtrace:1. ├─testthat::expect_warning(...) at test-xl_open.R:4:2
  2. │ └─testthat:::expect_condition_matching(...)
  3. │   └─testthat:::quasi_capture(...)
  4. │     ├─testthat (local) .capture(...)
  5. │     │ └─base::withCallingHandlers(...)
  6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  7. ├─testthat::expect_s3_class(...)
  8. │ └─testthat::quasi_label(enquo(object), arg = "object")
  9. │   └─rlang::eval_bare(expr, quo_get_env(quo))
 10. └─wb$open(interactive = FALSE)
 11.   ├─openxlsx2::xl_open(self, interactive = interactive)
 12.   └─openxlsx2:::xl_open.wbWorkbook(self, interactive = interactive)
 13.     ├─openxlsx2::xl_open(...)
 14.     └─x$clone()$save(temp_xlsx(macros = has_macros))

[ FAIL 75 | WARN 26 | SKIP 1 | PASS 496 ]
Error: Test failures
  1. @head on C:\ (default %TEMP%)
    No problems, works as expected.
  2. @gh_issue_263 on C:\ (default %TEMP%)
    Lots of issues: I wonder if the "differing number of rows" errors are due to unintended spaces and/or line breaks?
  3. @head on D:\ (at root)
    Lots of issues: the initial "Failed to create temporary directory" due to recursion.

@JanMarvin
Copy link
Owner Author

I've rebased this on main, just to make sure there was no pending issue and I've switched a few more dir.create() cases.

@christianrickert
Copy link

christianrickert commented Jul 14, 2022

About the unzip(file, exdir = xmlDir): 'exdir' does not exist error:

For example, readWorkbook.R the xmlDir is created implicitly by calling unzip with the exdir argument:

exdir: The directory to extract files to (the equivalent of unzip -d). It will be created if necessary.

I'd suggest to replace the implicit call with an explicit one:

xlDir <- dir_create(tmpDir, "_excelXMLRead")  # create folder here
on.exit(unlink(xmlDir, recursive = TRUE), add = TRUE)  # delete folder afterwards
xmlFiles <- unzip(file, exdir = xmlDir)  # folder not created here, already exists

@christianrickert
Copy link

christianrickert commented Jul 14, 2022

I've rebased this on main, just to make sure there was no pending issue and I've switched a few more dir.create() cases.

Thanks, I'm going to test the updated branch with D:\.

Update: the formatting issues are fixed with the rebasing, the errors left are just related to the creation of xmlDir - see my comment above.

testthat output

> # # @gh_issue_263 (rebased) on C:\ (default %TEMP%)
> test_check("openxlsx2")
Starting 2 test processes
[ FAIL 0 | WARN 0 | SKIP 1 | PASS 897 ]

══ Skipped tests ══════════════════════════════════════════════════════════════════════════════════
• empty test (1)

[ FAIL 0 | WARN 0 | SKIP 1 | PASS 897 ]


# # @gh_issue_263 (rebased) on D:\ (on root)
> test_check("openxlsx2")
Starting 2 test processes
[ FAIL 65 | WARN 1 | SKIP 1 | PASS 581 ]

══ Skipped tests ══════════════════════════════════════════════════════════════════════════════════
• empty test (1)

══ Failed tests ═══════════════════════════════════════════════════════════════════════════════════
── Error (test-class-comment.R:62:3): load comments ────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-class-comment.R:62:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_sources.R:5:3): read_xlsx from different sources ───────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::read_xlsx(xlsxFile) at test-read_sources.R:5:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_sources.R:29:3): wb_load from different sources ────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-read_sources.R:29:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_sources.R:44:3): get_date_origin from different sources ────
Error in `unzip(xlsxFile, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::get_date_origin(xlsxFile) at test-read_sources.R:44:2
 2.   └─utils::unzip(xlsxFile, exdir = xmlDir)
── Error (test-read_sources.R:60:3): read html source without r attribute on cell ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load("https://github.com/JanMarvin/openxlsx2/files/8702731/fichier_complementaire_ccam_descriptive_a_usage_pmsi_2021_v2.xlsx") at test-read_sources.R:60:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_sources.R:84:3): read <br> node in vml ─────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. ├─testthat::expect_silent(wb <- wb_load(temp_file)) at test-read_sources.R:84:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::wb_load(temp_file)
 10.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_sources.R:94:3): encoding ──────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-read_sources.R:94:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-clean_sheet.R:4:3): clean_sheet ─────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsx) at test-clean_sheet.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-cloneWorksheet.R:8:3): clone Worksheet with data ────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(file = file_name) at test-cloneWorksheet.R:8:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-cloneWorksheet.R:21:3): clone empty Worksheet ───────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(file = file_name) at test-cloneWorksheet.R:21:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-deleting_tables.R:128:3): Save and load Table Deletion ──────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(file = temp_file) at test-deleting_tables.R:128:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-fill_merged_cells.R:19:3): fill merged cells ────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. ├─testthat::expect_equal(...) at test-fill_merged_cells.R:19:2
 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
 3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
 4. └─openxlsx2::read_xlsx(tmp_file, fillMergedCells = FALSE)
 5.   └─openxlsx2::wb_to_df(...)
 6.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 7.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-formulas.R:4:3): load various formulas ──────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-formulas.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-helper_functions.R:92:3): ws_page_setup example ─────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(tmp) at test-helper_functions.R:92:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:4:3): Loading readTest.xlsx Sheet 1 ──────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-loading_workbook.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:16:3): Loading multiple pivot tables: loadPivotTables.xlsx works ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-loading_workbook.R:16:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:38:3): Load and saving a file with Threaded Comments works ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. ├─testthat::expect_silent(wb <- wb_load(fl)) at test-loading_workbook.R:38:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::wb_load(fl)
 10.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:47:3): Read and save file with inlineStr ─────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-loading_workbook.R:47:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:143:3): sheet visibility ─────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-loading_workbook.R:143:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:173:3): additional wb tests ──────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-loading_workbook.R:173:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:244:3): test headerFooter ────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(tmp1) at test-loading_workbook.R:244:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook.R:259:3): load workbook with chartsheet ────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. ├─testthat::expect_silent(z <- wb_load(fl)) at test-loading_workbook.R:259:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::wb_load(fl)
 10.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-loading_workbook_tables.R:4:3): Tables loaded correctly ─────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(...) at test-loading_workbook_tables.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:169:3): type = 'expression' work ───────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:169:2
  2.   ├─testthat::expect_silent(wb1 <- wb_load(path)) at test-conditional_formatting.R:18:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_load(path)
 11.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:181:3): type = 'duplicated' works ──────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:181:2
  2.   ├─testthat::expect_silent(wb1 <- wb_load(path)) at test-conditional_formatting.R:18:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_load(path)
 11.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:201:3): type = 'containsText' works ────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:201:2
  2.   ├─testthat::expect_silent(wb1 <- wb_load(path)) at test-conditional_formatting.R:18:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_load(path)
 11.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:220:3): type = 'notContainsText' works ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:220:2
  2.   ├─testthat::expect_silent(wb1 <- wb_load(path)) at test-conditional_formatting.R:18:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_load(path)
 11.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:233:3): type = 'beginsWith' works ──────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:233:2
  2.   ├─testthat::expect_silent(wb1 <- wb_load(path)) at test-conditional_formatting.R:18:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_load(path)
 11.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:252:3): type = 'endsWith' works ────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:252:2
  2.   ├─testthat::expect_silent(wb1 <- wb_load(path)) at test-conditional_formatting.R:18:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_load(path)
 11.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:259:3): type = 'colorScale' works ──────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::read_xlsx(...) at test-conditional_formatting.R:259:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:288:3): type = 'databar' works ─────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:288:2
  2.   ├─testthat::expect_silent(wb1 <- wb_load(path)) at test-conditional_formatting.R:18:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_load(path)
 11.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:307:3): type = 'between' works ─────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:307:2
  2.   ├─testthat::expect_silent(wb1 <- wb_load(path)) at test-conditional_formatting.R:18:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_load(path)
 11.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:340:3): type = 'topN' works ────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:340:2
  2.   ├─testthat::expect_silent(wb1 <- wb_load(path)) at test-conditional_formatting.R:18:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_load(path)
 11.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:374:3): type = 'bottomN' works ─────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:374:2
  2.   ├─testthat::expect_silent(wb1 <- wb_load(path)) at test-conditional_formatting.R:18:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_load(path)
 11.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:392:3): type as logical operators work ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2 (local) expect_save(wb) at test-conditional_formatting.R:392:2
  2.   ├─testthat::expect_silent(wb1 <- wb_load(path)) at test-conditional_formatting.R:18:2
  3.   │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  4.   │   ├─testthat (local) .capture(...)
  5.   │   │ ├─withr::with_output_sink(...)
  6.   │   │ │ └─base::force(code)
  7.   │   │ ├─base::withCallingHandlers(...)
  8.   │   │ └─base::withVisible(code)
  9.   │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 10.   └─openxlsx2::wb_load(path)
 11.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-conditional_formatting.R:402:3): colorScale ─────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::read_xlsx(...) at test-conditional_formatting.R:402:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-names.R:20:3): names ────────────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(tmp) at test-names.R:20:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:27:3): Maintaining Named Regions on Load ────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. ├─testthat::expect_equal(object = get_named_regions(wb), expected = get_named_regions(out_file)) at test-named_regions.R:27:2
 2. │ └─testthat::quasi_label(enquo(expected), expected.label, arg = "expected")
 3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
 4. └─openxlsx2::get_named_regions(out_file)
 5.   └─openxlsx2::wb_load(x)
 6.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:60:3): Correctly Loading Named Regions Created in Excel ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(filename) at test-named_regions.R:60:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:117:3): Load names from an Excel file with funky non-region names ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(filename) at test-named_regions.R:117:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:192:3): Missing rows in named regions ───────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::read_xlsx(...) at test-named_regions.R:192:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:265:3): Missing columns in named regions ────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::read_xlsx(...) at test-named_regions.R:265:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:307:3): Matching Substrings breaks reading named regions ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::get_named_regions(temp_file) at test-named_regions.R:307:2
 2.   └─openxlsx2::wb_load(x)
 3.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:334:3): Read namedRegion from specific sheet ────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::read_sheet_names(filename) at test-named_regions.R:334:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-named_regions.R:410:5): deprecation test ────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. ├─testthat::expect_warning(...) at test-named_regions.R:410:4
 2. │ └─testthat:::expect_condition_matching(...)
 3. │   └─testthat:::quasi_capture(...)
 4. │     ├─testthat (local) .capture(...)
 5. │     │ └─base::withCallingHandlers(...)
 6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 7. └─openxlsx2::wb_to_df(filename, definedName = "MyRange")
 8.   └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 9.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-protect-workbook.R:31:3): Reading protected Workbook ────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(file = temp_file) at test-protect-workbook.R:31:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_from_created_wb.R:84:3): Reading NAs and NaN values ────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. ├─testthat::expect_equal(read_xlsx(fileName), exp, ignore_attr = TRUE) at test-read_from_created_wb.R:84:2
 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
 3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
 4. └─openxlsx2::read_xlsx(fileName)
 5.   └─openxlsx2::wb_to_df(...)
 6.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 7.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_write_logicals.R:16:3): TRUE, FALSE, NA ────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::read_xlsx(fileName, sheet = 1, na.strings = "#N/A") at test-read_write_logicals.R:16:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_xlsx_correct_sheet.R:3:3): read_xlsx correct sheet ─────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::read_sheet_names(file = fl) at test-read_xlsx_correct_sheet.R:3:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-read_xlsx_random_seed.R:8:3): read_xlsx() does not change random seed ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::read_xlsx(tf) at test-read_xlsx_random_seed.R:8:2
 2.   └─openxlsx2::wb_to_df(...)
 3.     └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 4.       └─utils::unzip(file, exdir = xmlDir)
── Error (test-remove_worksheets.R:29:3): Deleting worksheets ──────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(tempFile) at test-remove_worksheets.R:29:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:4:3): xf ───────────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:40:3): border ──────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:40:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:68:3): cellStyle ───────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:68:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:94:3): tableStyle ──────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:94:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:119:3): dxf ────────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:119:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-styles_xml.R:145:3): colors ─────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(xlsxFile) at test-styles_xml.R:145:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-wb_functions.R:6:3): wb_to_df ───────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. ├─testthat::expect_silent(wb1 <- wb_load(xlsxFile)) at test-wb_functions.R:6:2
  2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
  3. │   ├─testthat (local) .capture(...)
  4. │   │ ├─withr::with_output_sink(...)
  5. │   │ │ └─base::force(code)
  6. │   │ ├─base::withCallingHandlers(...)
  7. │   │ └─base::withVisible(code)
  8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  9. └─openxlsx2::wb_load(xlsxFile)
 10.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-wb_functions.R:133:3): select_active_sheet ──────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(...) at test-wb_functions.R:133:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-wb_styles.R:4:3): wb_clone_sheet_style ──────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(fl) at test-wb_styles.R:4:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-Workbook_properties.R:33:3): Workbook properties ────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(temp_file) at test-Workbook_properties.R:33:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-writing_posixct.R:53:3): Writing mixed EDT/EST Posixct with write_data & write_datatable ──
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_to_df(xlsxFile, sheet = "write_data") at test-writing_posixct.R:53:2
 2.   └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 3.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-save.R:74:3): write_data2 ───────────────────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. └─openxlsx2::wb_load(file) at test-save.R:74:2
 2.   └─utils::unzip(file, exdir = xmlDir)
── Error (test-save.R:188:3): writing NA, NaN and Inf ──────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. ├─base::unname(unlist(wb_to_df(tmp))) at test-save.R:188:2
 2. ├─base::unlist(wb_to_df(tmp))
 3. └─openxlsx2::wb_to_df(tmp)
 4.   └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 5.     └─utils::unzip(file, exdir = xmlDir)
── Error (test-save.R:221:3): writing NA, NaN and Inf ──────────────────────────
Error in `unzip(file, exdir = xmlDir)`: 'exdir' does not exist
Backtrace:1. ├─base::unname(unlist(attr(wb_to_df(tmp, "Test1"), "tt"))) at test-save.R:221:2
 2. ├─base::unlist(attr(wb_to_df(tmp, "Test1"), "tt"))
 3. └─openxlsx2::wb_to_df(tmp, "Test1")
 4.   └─openxlsx2::wb_load(xlsxFile, sheet = sheet, data_only = TRUE)
 5.     └─utils::unzip(file, exdir = xmlDir)

[ FAIL 65 | WARN 1 | SKIP 1 | PASS 581 ]
Error: Test failures```


</p>
</details>

@JanMarvin
Copy link
Owner Author

About the unzip(file, exdir = xmlDir): 'exdir' does not exist error:

For example, readWorkbook.R the xmlDir is created implicitly by calling unzip with the exdir argument:

exdir: The directory to extract files to (the equivalent of unzip -d). It will be created if necessary.

I'd suggest to replace the implicit call with an explicit one:

xlDir <- dir_create(tmpDir, "_excelXMLRead")  # create folder here
on.exit(unlink(xmlDir, recursive = TRUE), add = TRUE)  # delete folder afterwards
xmlFiles <- unzip(file, exdir = xmlDir)  # folder not created here, already exists

Hi, sorry lost track of this issue (and while looking at it I hid your wall of testthat output above).

I've rebased once again and added a function to create the required directory explicitly. Though not sure if I got you here correctly. Could you please let me know if this solves the remaining issue(s)?

@christianrickert
Copy link

About the unzip(file, exdir = xmlDir): 'exdir' does not exist error:
For example, readWorkbook.R the xmlDir is created implicitly by calling unzip with the exdir argument:

exdir: The directory to extract files to (the equivalent of unzip -d). It will be created if necessary.

I'd suggest to replace the implicit call with an explicit one:

xlDir <- dir_create(tmpDir, "_excelXMLRead")  # create folder here
on.exit(unlink(xmlDir, recursive = TRUE), add = TRUE)  # delete folder afterwards
xmlFiles <- unzip(file, exdir = xmlDir)  # folder not created here, already exists

Hi, sorry lost track of this issue (and while looking at it I hid your wall of testthat output above).

I've rebased once again and added a function to create the required directory explicitly. Though not sure if I got you here correctly. Could you please let me know if this solves the remaining issue(s)?

(Borat voice) "Great success!"

Both test runs (for %USERPROFILE%\AppData\Local\Temp and D:\ completed successfully!
Example output for D:\:

> tempdir()
[1] "D:\\\\RtmpgBtXrG"
[...]
> test_check("openxlsx2")
Starting 2 test processes
[ FAIL 0 | WARN 0 | SKIP 1 | PASS 957 ]

══ Skipped tests ══════════════════════════════════════════════════════════════════════════════════
• empty test (1)

[ FAIL 0 | WARN 0 | SKIP 1 | PASS 957 ]

Thanks for the update!

@JanMarvin
Copy link
Owner Author

Yay! Thanks for testing! Will be merged this week. I'll add a test for this, otherwise it should be fine.

@christianrickert
Copy link

Thank you very much!

@JanMarvin JanMarvin merged commit e2f6fcf into main Aug 6, 2022
@JanMarvin JanMarvin deleted the gh_issue_263 branch August 6, 2022 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants