File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,15 @@ expect_setequal <- function(object, expected) {
3333 testthat_warn(" expect_setequal() ignores names" )
3434 }
3535
36+ expect_setequal_(act , exp )
37+ }
38+
39+ expect_setequal_ <- function (act , exp , trace_env = caller_env()) {
3640 act_miss <- unique(act $ val [! act $ val %in% exp $ val ])
3741 exp_miss <- unique(exp $ val [! exp $ val %in% act $ val ])
3842
3943 if (length(exp_miss ) || length(act_miss )) {
40- return (fail( paste0(
44+ msg <- paste0(
4145 act $ lab ,
4246 " (`actual`) and " ,
4347 exp $ lab ,
@@ -48,7 +52,8 @@ expect_setequal <- function(object, expected) {
4852 if (length(exp_miss )) {
4953 paste0(" * Only in `expected`: " , values(exp_miss ), " \n " )
5054 }
51- )))
55+ )
56+ return (fail(msg , trace_env = trace_env ))
5257 }
5358 pass(act $ val )
5459}
You can’t perform that action at this time.
0 commit comments