Skip to content

Commit c5f5472

Browse files
committed
Merged origin/main into revert-mapequal
2 parents a510793 + 8dcf1e2 commit c5f5472

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

R/expect-setequal.R

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ expect_contains <- function(object, expected) {
127127
act <- quasi_label(enquo(object))
128128
exp <- quasi_label(enquo(expected))
129129

130-
check_vector(object)
131-
check_vector(expected)
130+
check_vector(act$val, error_arg = "object")
131+
check_vector(exp$val, error_arg = "expected")
132132

133133
exp_miss <- !exp$val %in% act$val
134134
if (any(exp_miss)) {
@@ -156,8 +156,8 @@ expect_in <- function(object, expected) {
156156
act <- quasi_label(enquo(object))
157157
exp <- quasi_label(enquo(expected))
158158

159-
check_vector(object)
160-
check_vector(expected)
159+
check_vector(act$val, error_arg = "object")
160+
check_vector(exp$val, error_arg = "expected")
161161

162162
act_miss <- !act$val %in% exp$val
163163
if (any(act_miss)) {
@@ -181,11 +181,7 @@ expect_in <- function(object, expected) {
181181

182182
# Helpers ----------------------------------------------------------------------
183183

184-
check_vector <- function(
185-
x,
186-
error_arg = caller_arg(x),
187-
error_call = caller_env()
188-
) {
184+
check_vector <- function(x, error_arg, error_call = caller_env()) {
189185
if (!is_vector(x)) {
190186
stop_input_type(x, "a vector", arg = error_arg, call = error_call)
191187
}

0 commit comments

Comments
 (0)