diff --git a/paws.common/R/custom_s3.R b/paws.common/R/custom_s3.R index d8c10c948..d90df9a6e 100644 --- a/paws.common/R/custom_s3.R +++ b/paws.common/R/custom_s3.R @@ -65,7 +65,7 @@ dns_compatible_bucket_name <- function(bucket) { return( grepl(domain, bucket) && !grepl(ip_address, bucket) && - !grepl("..", bucket, fixed = T) + !grepl("..", bucket, fixed = TRUE) ) } @@ -499,7 +499,7 @@ handle_copy_source_param <- function(request) { } quote_source_header <- function(source, tags) { - result <- strsplit(source, VERSION_ID_SUFFIX, fixed = T)[[1]] + result <- strsplit(source, VERSION_ID_SUFFIX, fixed = TRUE)[[1]] if (is.na(result[2])) { return(tag_add(paws_url_encoder(result[1], "/"), tags)) } else { @@ -514,7 +514,7 @@ quote_source_header_from_list <- function(source, tags) { if (is.null(key <- source[["Key"]])) { stopf("CopySource list is missing required parameter: Key") } - if (grepl(VALID_S3_ARN, bucket, perl = T)) { + if (grepl(VALID_S3_ARN, bucket, perl = TRUE)) { final <- sprintf("%s/object/%s", bucket, key) } else { final <- sprintf("%s/%s", bucket, key) diff --git a/paws.common/R/handlers_rest.R b/paws.common/R/handlers_rest.R index 3ea0fd38e..218e36a79 100644 --- a/paws.common/R/handlers_rest.R +++ b/paws.common/R/handlers_rest.R @@ -194,7 +194,7 @@ rest_unmarshal_header <- function(value, type) { rest_unmarshal_header_map <- function(values, prefix, type) { value_names <- names(values) value_names <- value_names[ - grepl(sprintf("^%s", prefix), value_names, ignore.case = T) + grepl(sprintf("^%s", prefix), value_names, ignore.case = TRUE) ] result <- lapply(value_names, function(name) { rest_unmarshal_header(values[[name]], type) diff --git a/paws.common/R/iniutil.R b/paws.common/R/iniutil.R index fbba30e50..4eda5f810 100644 --- a/paws.common/R/iniutil.R +++ b/paws.common/R/iniutil.R @@ -36,7 +36,7 @@ read_ini <- function(file_name) { profile_nms <- gsub( "^[ \t\r\n]+|[ \t\r\n]+$", "", gsub("\\[|\\]", "", content[found]), - perl = T + perl = TRUE ) profiles <- vector("list", length = length(profile_nms)) names(profiles) <- profile_nms @@ -71,13 +71,13 @@ nested_ini_content <- function(sub_content, found_nested_content, sub_grp) { position <- which(found_nested_content) non_nest <- !(sub_grp %in% position) - profiles[non_nest] <- sub_content[sub_grp[non_nest], 2, drop = T] + profiles[non_nest] <- sub_content[sub_grp[non_nest], 2, drop = TRUE] start <- (sub_grp + 1) end <- c(sub_grp[-1] - 1, nrow(sub_content)) for (i in which(start <= end)) { items <- seq.int(start[i], end[i]) - profiles[[profile_nms[i]]] <- extract_ini_parameter(sub_content[items, , drop = F]) + profiles[[profile_nms[i]]] <- extract_ini_parameter(sub_content[items, , drop = FALSE]) } return(profiles) } diff --git a/paws.common/R/net.R b/paws.common/R/net.R index aec6625dd..ddade3403 100644 --- a/paws.common/R/net.R +++ b/paws.common/R/net.R @@ -176,7 +176,7 @@ is_compressed <- function(http_response) { } if (content_encoding == "gzip") { - bits_to_int <- function(x) sum(as.integer(x) * 2^(1:length(x) - 1)) + bits_to_int <- function(x) sum(as.integer(x) * 2^(seq_along(x) - 1)) cmf <- http_response$body[1] flg <- http_response$body[2] compression_method <- bits_to_int(rawToBits(cmf)[1:4]) diff --git a/paws.common/R/paginate.R b/paws.common/R/paginate.R index 48e29eec6..c66396e2a 100644 --- a/paws.common/R/paginate.R +++ b/paws.common/R/paginate.R @@ -67,8 +67,8 @@ paginate <- function(Operation, # Exit paginator if previous token matches current token # https://github.com/smithy-lang/smithy-typescript/blob/main/packages/core/src/pagination/createPaginator.ts#L53 if (isTRUE(StopOnSameToken)) { - previous_token <- unlist(fn[[paginator$input_token]], use.names = F) - if (identical(previous_token, unlist(new_tokens, use.names = F))) { + previous_token <- unlist(fn[[paginator$input_token]], use.names = FALSE) + if (identical(previous_token, unlist(new_tokens, use.names = FALSE))) { break } } @@ -176,7 +176,7 @@ paginate_update_fn <- function( pkg_name <- environmentName(environment(fn_call)) # Ensure method can be found. - if (!grepl("^paws", pkg_name, perl = T)) { + if (!grepl("^paws", pkg_name, perl = TRUE)) { stopf( "Unknown method: `%s`. Please check service methods and try again.", as.character(fn)[1] @@ -239,7 +239,7 @@ is_paginators <- function(fn) { fn_body[[2]][[3]]$paginator }, error = function(err) { - if (grepl("subscript out of bounds", err, perl = T)) { + if (grepl("subscript out of bounds", err, perl = TRUE)) { character() } else { stop(err) @@ -267,8 +267,8 @@ paginate_xapply <- function( # Exit paginator if previous token matches current token # https://github.com/smithy-lang/smithy-typescript/blob/main/packages/core/src/pagination/createPaginator.ts#L53 if (isTRUE(StopOnSameToken)) { - previous_token <- unlist(fn[[paginator$input_token]], use.names = F) - if (identical(previous_token, unlist(new_tokens, use.names = F))) { + previous_token <- unlist(fn[[paginator$input_token]], use.names = FALSE) + if (identical(previous_token, unlist(new_tokens, use.names = FALSE))) { break } } @@ -309,7 +309,7 @@ get_tokens <- function(resp, token, caller_env) { }, error = function(err) { # Return default character(0) for empty lists - if (grepl(token_error_msg, err[["message"]], perl = T)) { + if (grepl(token_error_msg, err[["message"]], perl = TRUE)) { character(0) } else { stop(err) @@ -321,9 +321,9 @@ get_tokens <- function(resp, token, caller_env) { } split_token <- function(token) { - token_prts <- unlist(strsplit(token, ".", fixed = T)) - token_prts <- unlist(strsplit(token_prts, "[", fixed = T)) - return(unlist(strsplit(token_prts, "]", fixed = T))) + token_prts <- unlist(strsplit(token, ".", fixed = TRUE)) + token_prts <- unlist(strsplit(token_prts, "[", fixed = TRUE)) + return(unlist(strsplit(token_prts, "]", fixed = TRUE))) } # This is a simple implementation of jmespath for R list: i.e. @@ -342,7 +342,7 @@ jmespath_index <- function(token, caller_env) { # Format character strings token_prts[found_alpha] <- paste0('"', token_prts[found_alpha], '"') - found <- grep("-", token_prts, fixed = T) + found <- grep("-", token_prts, fixed = TRUE) if (length(found) > 0) { # Path.To[-1].Token position <- found - 1 diff --git a/paws.common/R/queryutil.R b/paws.common/R/queryutil.R index 5d8fb6e22..55c77369d 100644 --- a/paws.common/R/queryutil.R +++ b/paws.common/R/queryutil.R @@ -106,7 +106,7 @@ query_parse_map <- function(values, value, prefix, tag, is_ec2 = FALSE) { # will be one R list element with no name, which we shouldn't process. map_entries <- !is.null(names(value)) if (map_entries) { - value[1:length(value)] <- value[names(value)] + value[seq_along(value)] <- value[names(value)] for (i in seq_along(value)) { map_key <- names(value)[i] diff --git a/paws.common/R/util.R b/paws.common/R/util.R index 8e244e97a..50044a166 100644 --- a/paws.common/R/util.R +++ b/paws.common/R/util.R @@ -183,7 +183,7 @@ check_dns_name <- function(bucket_name) { if (n < 3 || n > 63) { return(FALSE) } - m <- regexpr(LABEL_RE, bucket_name, perl = T) + m <- regexpr(LABEL_RE, bucket_name, perl = TRUE) match <- regmatches(bucket_name, m) if (identical(match, character(0)) || nchar(match) != n) { return(FALSE) diff --git a/paws.common/tests/testthat/test_custom_s3.R b/paws.common/tests/testthat/test_custom_s3.R index 4746da1b8..7c0f9db24 100644 --- a/paws.common/tests/testthat/test_custom_s3.R +++ b/paws.common/tests/testthat/test_custom_s3.R @@ -271,7 +271,7 @@ test_that("update url endpoint with new endpoint", { test_that("update url endpoint with new endpoint without new scheme", { org_ep <- "https://s3.eu-east-2.amazonaws.com" new_ep <- "sftp://s3.amazonaws.com" - actual <- set_request_url(org_ep, new_ep, F) + actual <- set_request_url(org_ep, new_ep, FALSE) expect_equal(actual, "https://s3.amazonaws.com") }) diff --git a/paws.common/tests/testthat/test_escape.R b/paws.common/tests/testthat/test_escape.R index 16d8ddbdf..dfb7d162d 100644 --- a/paws.common/tests/testthat/test_escape.R +++ b/paws.common/tests/testthat/test_escape.R @@ -30,7 +30,7 @@ test_that("check if non-ascci characters are correctly encoded", { test_that("check if encoded url is correctly decoded", { string <- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~`!@#$%^&*()=+[{]}\\|;:'\",<>/? " - url <- paste0(sample(strsplit(string, "")[[1]], 1e4, replace = T), collapse = "") + url <- paste0(sample(strsplit(string, "")[[1]], 1e4, replace = TRUE), collapse = "") url_encode <- paws_url_encoder(url) actual <- unescape(url_encode) @@ -41,7 +41,7 @@ test_that("check if encoded url is correctly decoded", { test_that("check if non-encoded url is correctly decoded", { string <- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~" - url <- paste(sample(strsplit(string, "")[[1]], 1e4, replace = T), collapse = "") + url <- paste(sample(strsplit(string, "")[[1]], 1e4, replace = TRUE), collapse = "") url_encode <- paws_url_encoder(url) actual <- unescape(url_encode) @@ -51,6 +51,6 @@ test_that("check if non-encoded url is correctly decoded", { test_that("check if json string is converted correctly", { expect <- "\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\\b\\t\\n\\u000b\\f\\r\\u000e\\u000f\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\\u0018\\u0019\\u001a\\u001b\\u001c\\u001d\\u001e\\u001f\\\\\\\"\\b\\f\\r\\t\\n\"" - string <- paste0(c(letters, LETTERS, intToUtf8(1:31, multiple = T), "\\", '"', "\b", "\f", "\r", "\t", "\n"), collapse = "") + string <- paste0(c(letters, LETTERS, intToUtf8(1:31, multiple = TRUE), "\\", '"', "\b", "\f", "\r", "\t", "\n"), collapse = "") expect_equal(json_convert_string(string), expect) }) diff --git a/paws.common/tests/testthat/test_handlers.R b/paws.common/tests/testthat/test_handlers.R index a86ad68ee..4d499cade 100644 --- a/paws.common/tests/testthat/test_handlers.R +++ b/paws.common/tests/testthat/test_handlers.R @@ -32,13 +32,13 @@ test_that("setting and adding handlers", { g <- function(x) 2 handlers$validate <- handlers_add_back(handlers$validate, g) - expect_equal(length(handlers$validate$list), 2) + expect_length(handlers$validate$list, 2) expect_equal(handlers$validate$list[[1]]$fn, f) expect_equal(handlers$validate$list[[2]]$fn, g) h <- function(x) 3 handlers$validate <- handlers_add_front(handlers$validate, h) - expect_equal(length(handlers$validate$list), 3) + expect_length(handlers$validate$list, 3) expect_equal(handlers$validate$list[[1]]$fn, h) expect_equal(handlers$validate$list[[2]]$fn, f) expect_equal(handlers$validate$list[[3]]$fn, g) diff --git a/paws.common/tests/testthat/test_handlers_core.R b/paws.common/tests/testthat/test_handlers_core.R index 24296faac..d96d3b8bc 100644 --- a/paws.common/tests/testthat/test_handlers_core.R +++ b/paws.common/tests/testthat/test_handlers_core.R @@ -4,7 +4,7 @@ test_that("validate_endpoint_handler no endpoint", { svc$handlers$validate <- HandlerList(validate_endpoint_handler) req <- new_request(svc, Operation(name = "Operation"), NULL, NULL) ret <- build(req) - expect_true(!is.null(ret$error)) + expect_false(is.null(ret$error)) }) test_that("validate_endpoint_handler no region", { @@ -12,7 +12,7 @@ test_that("validate_endpoint_handler no region", { svc$handlers$validate <- HandlerList(validate_endpoint_handler) req <- new_request(svc, Operation(name = "Operation"), NULL, NULL) ret <- build(req) - expect_true(!is.null(ret$error)) + expect_false(is.null(ret$error)) }) test_that("build_content_length_handler", { @@ -54,12 +54,12 @@ test_that("validate_response_handler", { r <- Request() r$http_response <- HttpResponse(status_code = 400) out <- validate_response_handler(r) - expect_true(!is.null(out$error)) + expect_false(is.null(out$error)) r <- Request() r$http_response <- HttpResponse(status_code = "500") out <- validate_response_handler(r) - expect_true(!is.null(out$error)) + expect_false(is.null(out$error)) }) expect_user_agent <- function(request) { diff --git a/paws.common/tests/testthat/test_handlers_ec2query.R b/paws.common/tests/testthat/test_handlers_ec2query.R index d4d6e57a9..1e5556e4f 100644 --- a/paws.common/tests/testthat/test_handlers_ec2query.R +++ b/paws.common/tests/testthat/test_handlers_ec2query.R @@ -244,12 +244,12 @@ test_that("unmarshal scalar members", { out <- req$data expect_equal(out$Char, "a") expect_equal(out$Double, 1.3) - expect_equal(out$FalseBool, FALSE) + expect_false(out$FalseBool) expect_equal(out$Float, 1.2) expect_equal(out$Long, 200L) expect_equal(out$Num, 123L) expect_equal(out$Str, "myname") - expect_equal(out$TrueBool, TRUE) + expect_true(out$TrueBool) }) op_output2 <- Structure( diff --git a/paws.common/tests/testthat/test_handlers_jsonrpc.R b/paws.common/tests/testthat/test_handlers_jsonrpc.R index c6a11c499..b6a41f829 100644 --- a/paws.common/tests/testthat/test_handlers_jsonrpc.R +++ b/paws.common/tests/testthat/test_handlers_jsonrpc.R @@ -481,12 +481,12 @@ test_that("unmarshal scalar members", { out <- req$data expect_equal(out$Char, "a") expect_equal(out$Double, 1.3) - expect_equal(out$FalseBool, FALSE) + expect_false(out$FalseBool) expect_equal(out$Float, 1.2) expect_equal(out$Long, 200L) expect_equal(out$Num, 123L) expect_equal(out$Str, "myname") - expect_equal(out$TrueBool, TRUE) + expect_true(out$TrueBool) }) op_output2 <- Structure( @@ -556,14 +556,14 @@ test_that("unmarshal list", { out <- req$data expect_equal(out$ListMember[1], "a") expect_equal(out$ListMember[2], NA_character_) - expect_equal(out$ListMemberMap[[1]], NULL) - expect_equal(out$ListMemberMap[[2]], NULL) - expect_equal(out$ListMemberMap[[3]], NULL) - expect_equal(out$ListMemberMap[[4]], NULL) - expect_equal(out$ListMemberStruct[[1]], NULL) - expect_equal(out$ListMemberStruct[[2]], NULL) - expect_equal(out$ListMemberStruct[[3]], NULL) - expect_equal(out$ListMemberStruct[[4]], NULL) + expect_null(out$ListMemberMap[[1]]) + expect_null(out$ListMemberMap[[2]]) + expect_null(out$ListMemberMap[[3]]) + expect_null(out$ListMemberMap[[4]]) + expect_null(out$ListMemberStruct[[1]]) + expect_null(out$ListMemberStruct[[2]]) + expect_null(out$ListMemberStruct[[3]]) + expect_null(out$ListMemberStruct[[4]]) }) op_output5 <- Structure( @@ -596,7 +596,7 @@ test_that("unmarshal ignores extra data", { ) req <- unmarshal(req) out <- req$data - expect_equal(names(out), "StrType") + expect_named(out, "StrType") expect_equal(out$StrType, character(0), ignore_attr = TRUE) }) diff --git a/paws.common/tests/testthat/test_handlers_query.R b/paws.common/tests/testthat/test_handlers_query.R index c722f2376..c53f63742 100644 --- a/paws.common/tests/testthat/test_handlers_query.R +++ b/paws.common/tests/testthat/test_handlers_query.R @@ -432,12 +432,12 @@ test_that("unmarshal scalar members", { out <- req$data expect_equal(out$Char, "a") expect_equal(out$Double, 1.3) - expect_equal(out$FalseBool, FALSE) + expect_false(out$FalseBool) expect_equal(out$Float, 1.2) expect_equal(out$Long, 200L) expect_equal(out$Num, 123L) expect_equal(out$Str, "myname") - expect_equal(out$TrueBool, TRUE) + expect_true(out$TrueBool) }) test_that("unmarshal scalar members", { diff --git a/paws.common/tests/testthat/test_handlers_restxml.R b/paws.common/tests/testthat/test_handlers_restxml.R index 9f4182e54..b2b8f621f 100644 --- a/paws.common/tests/testthat/test_handlers_restxml.R +++ b/paws.common/tests/testthat/test_handlers_restxml.R @@ -574,12 +574,12 @@ test_that("unmarshal scalar members", { out <- req$data expect_equal(out$Char, "a") expect_equal(out$Double, 1.3) - expect_equal(out$FalseBool, FALSE) + expect_false(out$FalseBool) expect_equal(out$Float, 1.2) expect_equal(out$Long, 200L) expect_equal(out$Num, 123L) expect_equal(out$Str, "myname") - expect_equal(out$TrueBool, TRUE) + expect_true(out$TrueBool) }) op_output2 <- Structure( diff --git a/paws.common/tests/testthat/test_iniutil.R b/paws.common/tests/testthat/test_iniutil.R index 4c9dbf57c..8712490e3 100644 --- a/paws.common/tests/testthat/test_iniutil.R +++ b/paws.common/tests/testthat/test_iniutil.R @@ -20,8 +20,8 @@ test_that("Ignores lines starting with # and ;", { # clear down cache paws_reset_cache() content <- read_ini("data_ini") - expect_true(!("ignore1" %in% names(content))) - expect_true(!("ignore2" %in% names(content))) + expect_false(("ignore1" %in% names(content))) + expect_false(("ignore2" %in% names(content))) }) test_that("Reads in profile with space in name", { diff --git a/paws.common/tests/testthat/test_net.R b/paws.common/tests/testthat/test_net.R index 4b3ef94c8..f8524796e 100644 --- a/paws.common/tests/testthat/test_net.R +++ b/paws.common/tests/testthat/test_net.R @@ -74,7 +74,7 @@ test_that("don't decompress the body when already decompressed", { if (resp$status_code == 200) { expect_equal(resp$status_code, 200) expect_error(body <- jsonlite::fromJSON(rawToChar(resp$body)), NA) - expect_equal(body$gzipped, TRUE) + expect_true(body$gzipped) } }) diff --git a/paws.common/tests/testthat/test_retry.R b/paws.common/tests/testthat/test_retry.R index 1a5fecd44..84bfa82f7 100644 --- a/paws.common/tests/testthat/test_retry.R +++ b/paws.common/tests/testthat/test_retry.R @@ -47,7 +47,7 @@ test_that("check exponential back off", { mockery::stub(exp_back_off, "Sys.sleep", mock_sys_sleep) exp_back_off(error, 1, 2) - expect_true(mock_arg(mock_sys_sleep)[[1]] < 20) + expect_lt(mock_arg(mock_sys_sleep)[[1]], 20) }) test_that("check exponential back off iteration greater 20", { diff --git a/paws.common/tests/testthat/test_service.R b/paws.common/tests/testthat/test_service.R index 6d6b6e682..3f338174c 100644 --- a/paws.common/tests/testthat/test_service.R +++ b/paws.common/tests/testthat/test_service.R @@ -8,7 +8,7 @@ test_that("new_handlers", { expect_false(contains(example, 3)) handlers <- new_handlers("ec2query", "v4") - expect_equal(names(handlers), names(Handlers())) + expect_named(handlers, names(Handlers())) expect_true(contains(handlers$unmarshal, ec2query_unmarshal)) expect_true(contains(handlers$sign, v4_sign_request_handler)) @@ -36,9 +36,9 @@ test_that("new_service", { Sys.setenv("AWS_REGION" = "region") service <- new_service(metadata, handlers, cfgs) - expect_equal(names(service$client_info), names(ClientInfo())) - expect_equal(names(service$config), names(Config())) - expect_equal(names(service$handlers), names(Handlers())) + expect_named(service$client_info, names(ClientInfo())) + expect_named(service$config, names(Config())) + expect_named(service$handlers, names(Handlers())) expect_equal(service$client_info$service_name, metadata$service_name) expect_equal(service$client_info$service_id, metadata$service_id) @@ -60,7 +60,7 @@ test_that("new_service null cfgs", { Sys.setenv("AWS_REGION" = "region") service <- new_service(metadata, handlers) - expect_equal(names(service$config), names(Config())) + expect_named(service$config, names(Config())) expect_equal(service$config$region, "region") }) @@ -116,7 +116,7 @@ test_that("test custom config credentials take priority", { }) test_that("test service endpoint config file with service present", { - mock_get_config_file_path <- mock2("data_ini", cycle = T) + mock_get_config_file_path <- mock2("data_ini", cycle = TRUE) mockery::stub(check_config_file_endpoint, "get_config_file_path", mock_get_config_file_path) s3_endpoint <- check_config_file_endpoint("localstack", "s3") diff --git a/paws.common/tests/testthat/test_struct.R b/paws.common/tests/testthat/test_struct.R index 72e78c308..e37abf2be 100644 --- a/paws.common/tests/testthat/test_struct.R +++ b/paws.common/tests/testthat/test_struct.R @@ -1,7 +1,7 @@ test_that("struct constructors", { Foo <- struct(a = "", b = NULL) bar <- Foo() - expect_identical(names(bar), c("a", "b")) + expect_named(bar, c("a", "b")) }) test_that("struct extract", { diff --git a/paws.common/tests/testthat/test_util.R b/paws.common/tests/testthat/test_util.R index 0fcb01423..ffbbb3324 100644 --- a/paws.common/tests/testthat/test_util.R +++ b/paws.common/tests/testthat/test_util.R @@ -1,37 +1,37 @@ test_that("is_empty", { - expect_equal(is_empty(NULL), TRUE) - expect_equal(is_empty(""), TRUE) - expect_equal(is_empty(NA_character_), TRUE) - expect_equal(is_empty(NA_integer_), TRUE) - expect_equal(is_empty(NA_real_), TRUE) - expect_equal(is_empty(character(0)), TRUE) - expect_equal(is_empty(logical(0)), TRUE) - expect_equal(is_empty(numeric(0)), TRUE) - expect_equal(is_empty(raw(0)), TRUE) - expect_equal(is_empty(list()), TRUE) - expect_equal(is_empty(list(list())), TRUE) - expect_equal(is_empty(list(list(list(), list()))), TRUE) + expect_true(is_empty(NULL)) + expect_true(is_empty("")) + expect_true(is_empty(NA_character_)) + expect_true(is_empty(NA_integer_)) + expect_true(is_empty(NA_real_)) + expect_true(is_empty(character(0))) + expect_true(is_empty(logical(0))) + expect_true(is_empty(numeric(0))) + expect_true(is_empty(raw(0))) + expect_true(is_empty(list())) + expect_true(is_empty(list(list()))) + expect_true(is_empty(list(list(list(), list())))) - expect_equal(is_empty("foo"), FALSE) - expect_equal(is_empty(123), FALSE) - expect_equal(is_empty(TRUE), FALSE) - expect_equal(is_empty(FALSE), FALSE) - expect_equal(is_empty(charToRaw("foo")), FALSE) - expect_equal(is_empty(list(1)), FALSE) - expect_equal(is_empty(list(list(list(), list(1)))), FALSE) + expect_false(is_empty("foo")) + expect_false(is_empty(123)) + expect_false(is_empty(TRUE)) + expect_false(is_empty(FALSE)) + expect_false(is_empty(charToRaw("foo"))) + expect_false(is_empty(list(1))) + expect_false(is_empty(list(list(list(), list(1))))) }) test_that("is_empty_xml", { - expect_equal(is_empty_xml(NA_character_), TRUE) - expect_equal(is_empty_xml(character(0)), TRUE) - expect_equal(is_empty(list()), TRUE) - expect_equal(is_empty(list(list())), TRUE) - expect_equal(is_empty(list(list(list(), list()))), TRUE) + expect_true(is_empty_xml(NA_character_)) + expect_true(is_empty_xml(character(0))) + expect_true(is_empty(list())) + expect_true(is_empty(list(list()))) + expect_true(is_empty(list(list(list(), list())))) - expect_equal(is_empty_xml("foo"), FALSE) - expect_equal(is_empty_xml(""), FALSE) - expect_equal(is_empty_xml(list(1)), FALSE) - expect_equal(is_empty_xml(list(list(list(), list("")))), FALSE) + expect_false(is_empty_xml("foo")) + expect_false(is_empty_xml("")) + expect_false(is_empty_xml(list(1))) + expect_false(is_empty_xml(list(list(list(), list(""))))) }) test_that("call_with_args", {