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

Add assertion for a non-continuous sequence in an Iterable #271

Open
Jasz opened this issue Jul 12, 2022 · 0 comments
Open

Add assertion for a non-continuous sequence in an Iterable #271

Jasz opened this issue Jul 12, 2022 · 0 comments

Comments

@Jasz
Copy link

Jasz commented Jul 12, 2022

This is a request for a new assertion which checks whether the subject Iterable contains the given elements in order provided, possibly with other items between them. AssertJ has that feature: containsSubsequence(ELEMENT... sequence), though I'm not a fan of that name. I'd call it either containsNonContinuousSequence or containsInOrder (as opposed to just contains, which doesn't verify the order and containsExactly, which checks the order, but doesn't allow other items).

This was already raised in #156 but the closing PR resolved only half of that feature request. Additionally, that PR implemented containsSequence on Lists, but I think it'd make more sense to implement that more broadly on Iterables.

I could try implementing this if that's okay.

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

No branches or pull requests

1 participant