Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7bb579d

Browse files
committed
Fix unused argument (env) error
1 parentc9a1420 commit7bb579d

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

‎R/zzz-pkgdepends-config.R‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ default_windows_archs <- function() {
77

88
default_update_after<-function() as.difftime(24,units="hours")
99

10-
env_decode_dependencies<-function(x,name) {
10+
env_decode_dependencies<-function(x,name,...) {
1111
if (tolower(x)%in% c("yes","true","1","on"))return(TRUE)
1212
if (tolower(x)%in% c("no","false","0","off"))return(FALSE)
1313
if (tolower(x)=="na")return(NA)
1414
strsplit(x,";",fixed=TRUE)[[1]]
1515
}
1616

17-
env_decode_difftime<-function(x,name) {
17+
env_decode_difftime<-function(x,name,...) {
1818
if (nchar(x)>=2) {
1919
unit<- substr(x, nchar(x), nchar(x))
2020
unit<- c(s="secs",m="mins",h="hours",d="days")[unit]

‎tests/testthat/test-config.R‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
test_that("current_config runs without error", {
2+
expect_no_error(current_config())
3+
})
4+
5+
test_that("current_config runs without error when difftime config set", {
6+
withr::local_envvar(PKG_SYSREQS_DB_UPDATE_TIMEOUT="30")
7+
expect_error(
8+
current_config()$get("sysreqs_db_update_timeout"),
9+
"Invalid time interval specification"
10+
)
11+
withr::local_envvar(PKG_SYSREQS_DB_UPDATE_TIMEOUT="30s")
12+
expect_equal(
13+
current_config()$get("sysreqs_db_update_timeout"),
14+
as.difftime(30,units='secs'),
15+
ignore_attr=TRUE
16+
)
17+
withr::local_envvar(PKG_SYSREQS_DB_UPDATE_TIMEOUT="30h")
18+
expect_equal(
19+
current_config()$get("sysreqs_db_update_timeout"),
20+
as.difftime(30,units="hours"),
21+
ignore_attr=TRUE
22+
)
23+
})
24+
stopifnot(Sys.getenv('PKG_SYSREQS_DB_UPDATE_TIMEOUT')=='')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp