Skip to content

Commit 60d0eb7

Browse files
committed
Adjust set_equal and friends
1 parent 118cf20 commit 60d0eb7

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

R/expect-setequal.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ expect_contains <- function(object, expected) {
138138
if (any(exp_miss)) {
139139
return(fail(paste0(
140140
act$lab,
141-
" (`actual`) doesn't fully contain all the values in ",
141+
" doesn't fully contain all the values in ",
142142
exp$lab,
143-
" (`expected`).\n",
144-
paste0("* Missing from `actual`: ", values(exp$val[exp_miss]), "\n"),
145-
paste0("* Present in `actual`: ", values(act$val), "\n")
143+
".\n",
144+
paste0("* Missing from ", act$lab, ": ", values(exp$val[exp_miss]), "\n"),
145+
paste0("* Present in ", act$lab, ": ", values(act$val), "\n")
146146
)))
147147
}
148148

@@ -164,11 +164,11 @@ expect_in <- function(object, expected) {
164164
if (any(act_miss)) {
165165
return(fail(paste0(
166166
act$lab,
167-
" (`actual`) isn't fully contained within ",
167+
" isn't fully contained within ",
168168
exp$lab,
169-
" (`expected`).\n",
170-
paste0("* Missing from `expected`: ", values(act$val[act_miss]), "\n"),
171-
paste0("* Present in `expected`: ", values(exp$val), "\n")
169+
".\n",
170+
paste0("* Missing from ", act$lab, ": ", values(act$val[act_miss]), "\n"),
171+
paste0("* Present in ", act$lab, ": ", values(exp$val), "\n")
172172
)))
173173
}
174174

tests/testthat/_snaps/expect-setequal.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,29 @@
4545

4646
# expect_contains() gives useful message on failure
4747

48-
`x1` (`actual`) doesn't fully contain all the values in `x2` (`expected`).
49-
* Missing from `actual`: "d"
50-
* Present in `actual`: "a", "b", "c"
48+
`x1` doesn't fully contain all the values in `x2`.
49+
* Missing from `x1`: "d"
50+
* Present in `x1`: "a", "b", "c"
5151

5252

5353
---
5454

55-
`x1` (`actual`) doesn't fully contain all the values in `x3` (`expected`).
56-
* Missing from `actual`: "d", "e"
57-
* Present in `actual`: "a", "b", "c"
55+
`x1` doesn't fully contain all the values in `x3`.
56+
* Missing from `x1`: "d", "e"
57+
* Present in `x1`: "a", "b", "c"
5858

5959

6060
# expect_in() gives useful message on failure
6161

62-
`x1` (`actual`) isn't fully contained within `x2` (`expected`).
63-
* Missing from `expected`: "a"
64-
* Present in `expected`: "b", "c"
62+
`x1` isn't fully contained within `x2`.
63+
* Missing from `x1`: "a"
64+
* Present in `x1`: "b", "c"
6565

6666

6767
---
6868

69-
`x1` (`actual`) isn't fully contained within `x3` (`expected`).
70-
* Missing from `expected`: "a", "b"
71-
* Present in `expected`: "d", "e"
69+
`x1` isn't fully contained within `x3`.
70+
* Missing from `x1`: "a", "b"
71+
* Present in `x1`: "d", "e"
7272

7373

0 commit comments

Comments
 (0)