Skip to content
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

Replace the tuple! macro with an implementation of Matcher for tuples #260

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

hovinen
Copy link
Collaborator

@hovinen hovinen commented Jul 14, 2023

This means that one can just put a bunch of matchers into a tuple and the result will itself be a matcher against corresponding tuples:

let value = (1, 2);
verify_that!(value, (eq(1), eq(2)))

There is no need for a separate macro for this, since one can implement Matcher for a tuple of matchers directly.

This is a breaking change, since it eliminates the tuple! macro. To port existing code, one just removes the call to tuple! and adds a trailing comma if necessary.

@hovinen hovinen force-pushed the impl-matcher-for-tuples branch 3 times, most recently from 75ae2ed to 50b8b80 Compare July 14, 2023 14:25
…ples.

This means that one can just put a bunch of matchers into a tuple and the result will itself be a matcher against corresponding tuples:

```
let value = (1, 2);
verify_that!(value, (eq(1), eq(2)))
```

There is no need for a separate macro for this, since one can implement `Matcher` for a tuple of matchers directly.

This is a breaking change, since it eliminates the `tuple!` macro. To port existing code, one just removes the call to `tuple!` and adds a trailing comma if necessary.
@hovinen hovinen force-pushed the impl-matcher-for-tuples branch from 50b8b80 to 6837e48 Compare July 14, 2023 14:31
@copybara-service copybara-service bot merged commit 9e610d5 into main Jul 14, 2023
@gribozavr gribozavr deleted the impl-matcher-for-tuples branch February 17, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant