Skip to content

Commit 13cc3e2

Browse files
committed
use expect_waldo_equal_() in expect_named()
1 parent cb09657 commit 13cc3e2

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

R/expect-named.R

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,10 @@ expect_named <- function(
4949

5050
if (ignore.order) {
5151
act <- labelled_value(act_names, act$lab)
52-
return(expect_setequal_(act, exp))
52+
return(expect_setequal_(act, exp, prefix = "Names of "))
5353
} else {
54-
if (!identical(act$names, exp$val)) {
55-
msg <- sprintf(
56-
"Names of %s (%s) don't match %s",
57-
act$lab,
58-
paste0("'", act$names, "'", collapse = ", "),
59-
paste0("'", exp$val, "'", collapse = ", ")
60-
)
61-
return(fail(msg))
62-
}
54+
act <- labelled_value(act_names, act$lab)
55+
return(expect_waldo_equal_("equal", act, exp))
6356
}
6457

6558
pass(act$val)

0 commit comments

Comments
 (0)