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

Pairwise isn't tested for enumerator disposal #650

Closed
atifaziz opened this issue Nov 6, 2019 · 0 comments · Fixed by #937
Closed

Pairwise isn't tested for enumerator disposal #650

atifaziz opened this issue Nov 6, 2019 · 0 comments · Fixed by #937

Comments

@atifaziz
Copy link
Member

atifaziz commented Nov 6, 2019

Pairwise tests don't test for enumerator disposal in:

[Test]
public void PairwiseWideSourceSequence()
{
var result = new[] { "a", "b", "c", "d" }.Pairwise((x, y) => x + y);
result.AssertSequenceEqual("ab", "bc", "cd");
}

and:

public void PairwiseWithSequenceShorterThanTwo(int count)
{
var source = Enumerable.Range(0, count);
var result = source.Pairwise(BreakingFunc.Of<int, int, int>());
Assert.That(result, Is.Empty);
}

This came up while reviewing issue #649. Thanks @Orace!

@atifaziz atifaziz changed the title Pairwise isn't tested for enumerator disposal Pairwise isn't tested for enumerator disposal Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant