Skip to content

Commit e9e5812

Browse files
committed
remove redundency in act_names
1 parent b29cd06 commit e9e5812

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/expect-named.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ expect_named <- function(
3636
check_bool(ignore.case)
3737

3838
act <- quasi_label(enquo(object), label)
39-
act$names <- names(act$val)
4039

4140
if (missing(expected)) {
4241
return(expect_has_names_(act))
@@ -45,7 +44,7 @@ expect_named <- function(
4544
exp <- quasi_label(enquo(expected), arg = "expected")
4645

4746
exp$val <- normalise_names(exp$val, ignore.order, ignore.case)
48-
act_names <- normalise_names(act$names, ignore.order, ignore.case)
47+
act_names <- normalise_names(names(act$val), ignore.order, ignore.case)
4948

5049
if (ignore.order) {
5150
act <- labelled_value(act_names, act$lab)
@@ -74,7 +73,8 @@ normalise_names <- function(x, ignore.order = FALSE, ignore.case = FALSE) {
7473
}
7574

7675
expect_has_names_ <- function(act) {
77-
if (identical(act$names, NULL)) {
76+
act_names <- names(act$val)
77+
if (identical(act_names, NULL)) {
7878
msg <- sprintf("%s does not have names.", act$lab)
7979
return(fail(msg))
8080
}

0 commit comments

Comments
 (0)