-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
Equal predicate for array of tuples #1065
Conversation
Added ability to check an array of tuples for equivalence (useful for MOCs generated by Sourcery)
I love this. It's great. I do wonder if maybe it would be better to do this using type parameter packs? (And similarly, go back to the equal+tuples and reimplement it using type parameter packs - which would be an entirely separate PR). OTOH, as written, this will support earlier versions of Swift. |
Fixed swiftlint issues
Looks like type parameter packs is useless in this case :( |
Bummer. I'll look into redoing this to use parameter packs (if possible) at a later date. For now, this is good and I don't see any reason to block it any more than I have. Thanks for your contribution!
Thanks! |
🤝 |
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [Quick/Nimble](https://togithub.com/Quick/Nimble) | minor | `from: "12.1.0"` -> `from: "12.2.0"` | --- ### Release Notes <details> <summary>Quick/Nimble (Quick/Nimble)</summary> ### [`v12.2.0`](https://togithub.com/Quick/Nimble/releases/tag/v12.2.0) [Compare Source](https://togithub.com/Quick/Nimble/compare/v12.1.0...v12.2.0) ### Highlights the `equal` matcher now supports arrays of tuples. For example: ```swift expect([ (1, 2), (3, 4) ]).to(equal([ (1, 2), (3, 4) ])) ``` Thanks [@​faroman](https://togithub.com/faroman) for their contribution! ### Automatically Generated Release Notes #### What's Changed - Fix typo in README.md by [@​nemesis](https://togithub.com/nemesis) in [https://github.com/Quick/Nimble/pull/1066](https://togithub.com/Quick/Nimble/pull/1066) - Equal predicate for array of tuples by [@​faroman](https://togithub.com/faroman) in [https://github.com/Quick/Nimble/pull/1065](https://togithub.com/Quick/Nimble/pull/1065) #### New Contributors - [@​nemesis](https://togithub.com/nemesis) made their first contribution in [https://github.com/Quick/Nimble/pull/1066](https://togithub.com/Quick/Nimble/pull/1066) - [@​faroman](https://togithub.com/faroman) made their first contribution in [https://github.com/Quick/Nimble/pull/1065](https://togithub.com/Quick/Nimble/pull/1065) **Full Changelog**: Quick/Nimble@v12.1.0...v12.2.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41Ny4yIiwidXBkYXRlZEluVmVyIjoiMzYuNTcuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
Added ability to check an array of tuples for equivalence.
Nimble provides such API for tuples, but not for arrays of tuples.
The new feature was implemented by copy-pasting the
Equal+Tuple.swift
file with the necessary adjustments.Existing behavior was NOT changed, just added new functionality
Nothing was refactored, but extended
EqualTest.swift
with new testsThis change introduced because I use MOCs generator from Sourcery
which produces arrays of tuples and it will be useful to compare such arrays in a convenient way
Tests are added into
EqualTest.swift
and successfully passed (via\.test
tool)Code is documented
Public API is NOT broken (major version bump is NOT required)
This is a new feature (minor version bump is desirable)
Unfortunately, there is a lot of duplicated code in the tests, but I can't get rid of it :(