-
Notifications
You must be signed in to change notification settings - Fork 340
Implement expect_disjoint()
#2239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
25959a4
0d18c57
86ef654
eb9eca6
100e4e0
3d32674
2f5a8a4
e73be51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,3 +148,20 @@ test_that("expect_in() gives useful message on failure", { | |
| expect_snapshot_failure(expect_in(x1, x2)) | ||
| expect_snapshot_failure(expect_in(x1, x3)) | ||
| }) | ||
|
|
||
| # disjoint ---------------------------------------------------------------- | ||
|
|
||
| test_that("expect_disjoint() succeeds when appropriate", { | ||
| expect_success(expect_disjoint(1, letters)) | ||
| expect_success(expect_disjoint(LETTERS, letters)) | ||
| expect_success(expect_disjoint(character(), letters)) | ||
| }) | ||
|
|
||
| test_that("expect_disjoint() gives useful message on failure", { | ||
| x1 <- c("a", "b", "c") | ||
| x2 <- c("c", "d") | ||
| x3 <- c("b", "c", "d") | ||
|
|
||
| expect_snapshot_failure(expect_disjoint(x1, x2)) | ||
| expect_snapshot_failure(expect_disjoint(x1, x3)) | ||
| }) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be useful to have a test for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the review. I made the requested changes. In doing so, I might have stumbled onto something else: I think that the reason is that the call of I could fix those missing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @stibu81 that's because the expectation style has changed since you started working on this PR 😬 I've updated your expectation to the new style and There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems I picked a bad moment for this... 😆 Thanks for fixing it. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I like having this capitalized more