Skip to content

Commit 100e4e0

Browse files
committed
resolve review comments from @DavisVaughan
1 parent eb9eca6 commit 100e4e0

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

R/expect-setequal.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ expect_disjoint <- function(object, expected) {
165165
)
166166
msg_act <- c(
167167
sprintf("Actual: %s", values(act$val)),
168-
sprintf("Expected: none of %s", values(exp$val)),
168+
sprintf("Expected: None of %s", values(exp$val)),
169169
sprintf("Invalid: %s", values(act$val[act_common]))
170170
)
171171
fail(c(msg_exp, msg_act))

tests/testthat/_snaps/expect-setequal.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
Error:
152152
! Expected `x1` to be disjoint from `x2`.
153153
Actual: "a", "b", "c"
154-
Expected: none of "c", "d"
154+
Expected: None of "c", "d"
155155
Invalid: "c"
156156

157157
---
@@ -162,6 +162,17 @@
162162
Error:
163163
! Expected `x1` to be disjoint from `x3`.
164164
Actual: "a", "b", "c"
165-
Expected: none of "b", "c", "d"
165+
Expected: None of "b", "c", "d"
166166
Invalid: "b", "c"
167167

168+
---
169+
170+
Code
171+
expect_disjoint(NA, c("a", NA))
172+
Condition
173+
Error:
174+
! Expected NA to be disjoint from `c("a", NA)`.
175+
Actual: NA
176+
Expected: None of "a", NA
177+
Invalid: NA
178+

tests/testthat/test-expect-setequal.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,5 @@ test_that("expect_disjoint() gives useful message on failure", {
164164

165165
expect_snapshot_failure(expect_disjoint(x1, x2))
166166
expect_snapshot_failure(expect_disjoint(x1, x3))
167+
expect_snapshot_failure(expect_disjoint(NA, c("a", NA)))
167168
})

0 commit comments

Comments
 (0)