Skip to content

Commit

Permalink
Merge pull request #217 from ycphs/revert-216-215-setops-list
Browse files Browse the repository at this point in the history
Revert "resolves #215"
  • Loading branch information
ycphs authored Jul 5, 2021
2 parents d179602 + 00917a2 commit 541a6ae
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 94 deletions.
4 changes: 0 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# openxlsx (development version)

## Fixes

* `openxlsx_setOp()` now works with named list ([#215](https://github.com/ycphs/openxlsx/issues/215))

# openxlsx 4.2.4

## Fixes
Expand Down
2 changes: 1 addition & 1 deletion R/openxlsx.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ openxlsx_setOp <- function(x, value) {
stop("x cannot be an unnamed list", call. = FALSE)
}

return(invisible(mapply(openxlsx_setOp, x = names(x), value = x)))
mapply(openxlsx_setOp, x = names(x), value = x)
}

value <- as.list(value)
Expand Down
6 changes: 4 additions & 2 deletions revdep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
|tz |UTC |
|date |2021-07-05 |


# Dependencies

|package |old |new |Δ |
Expand All @@ -23,8 +24,10 @@

# Revdeps


## Failed to check (28)


|package |version |error |warning |note |
|:--------------|:-------|:-----|:-------|:----|
|appreci8R |? | | | |
Expand All @@ -43,11 +46,10 @@
|MatrixQCvis |? | | | |
|MicroSEC |? | | | |
|nanotatoR |? | | | |
|openPrimeR |? | | | |
|PloGO2 |? | | | |
|rbiom |? | | | |
|sangeranalyseR |1.2.0 |1 |1 |2 |
|RIPAT |? | | | |
|sangeranalyseR |? | | | |
|SEtools |? | | | |
|sigFeature |? | | | |
|stplanr |? | | | |
Expand Down
66 changes: 0 additions & 66 deletions revdep/failures.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,39 +552,6 @@ ERROR: lazy loading failed for package ‘hypeR’



```
# openPrimeR
<details>
* Version:
* GitHub: https://github.com/ycphs/openxlsx
* Source code: NA
* Number of recursive dependencies: 0
</details>
## Error before installation
### Devel
```






```
### CRAN
```






```
# PloGO2
Expand Down Expand Up @@ -651,39 +618,6 @@ ERROR: lazy loading failed for package ‘hypeR’



```
# RIPAT
<details>
* Version:
* GitHub: https://github.com/ycphs/openxlsx
* Source code: NA
* Number of recursive dependencies: 0
</details>
## Error before installation
### Devel
```






```
### CRAN
```






```
# sangeranalyseR
Expand Down
24 changes: 3 additions & 21 deletions tests/testthat/test-options.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,17 @@ test_that("option names are appropriate", {

test_that("changing options", {
op <- options()
on.exit(options(op), add = TRUE)

# Set via options()
options(openxlsx.borders = "whatever")
options(openxlsx.border = "whatever")
expect_equal(openxlsx_getOp("borders"), getOption("openxlsx.borders"))
expect_equal(openxlsx_getOp("borders"), "whatever")

# Set via openxlsx_setOp()
openxlsx_setOp("borders", "new_whatever")
expect_equal(openxlsx_getOp("borders"), getOption("openxlsx.borders"))
expect_equal(openxlsx_getOp("borders"), "new_whatever")

# with openxlsx. prefix
openxlsx_setOp("openxlsx.borders", "new_new_whatever")
expect_equal(openxlsx_getOp("openxlsx.borders"), getOption("openxlsx.borders"))
expect_equal(openxlsx_getOp("openxlsx.borders"), "new_new_whatever")

options(openxlsx.tableStyle = "Cool format")
expect_equal(openxlsx_getOp("tableStyle"), openxlsx_getOp("openxlsx.tableStyle"))

# Setting to NULL will return default
options(openxlsx.borders = NULL)
options(openxlsx.border = NULL)
expect_equal(openxlsx_getOp("borders"), op.openxlsx[["openxlsx.borders"]])

# Bad options names will trigger warning but still be produced
Expand All @@ -37,12 +27,4 @@ test_that("changing options", {

# Multiple Ops returns error
expect_error(openxlsx_getOp(c("withFilter", "borders")), "length 1")

options(op)
})

test_that("openxlsx_setOp() works with list [#215]", {
op <- options()
expect_error(openxlsx_setOp(list(withFilter = TRUE, keepNA = TRUE)), NA)
options(op)
})

0 comments on commit 541a6ae

Please sign in to comment.