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 a test for IndexOfAnyValues.GetValues #80038

Merged
merged 2 commits into from
Dec 30, 2022

Conversation

MihaZupan
Copy link
Member

GetValues is only used by the debug view so we had no test coverage of it.

@MihaZupan MihaZupan added this to the 8.0.0 milestone Dec 29, 2022
@MihaZupan MihaZupan self-assigned this Dec 29, 2022
@ghost
Copy link

ghost commented Dec 29, 2022

Tagging subscribers to this area: @dotnet/area-system-memory
See info in area-owners.md if you want to be subscribed.

Issue Details

GetValues is only used by the debug view so we had no test coverage of it.

Author: MihaZupan
Assignees: MihaZupan
Labels:

area-System.Memory

Milestone: 8.0.0

@@ -13,6 +15,59 @@ namespace System.SpanTests
{
public static partial class SpanTests
{
private static readonly Func<IndexOfAnyValues<byte>, byte[]> s_getValuesByteMethod =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess you're intentionally getting it from IndexOfAnyValues<T> rather than IndexOfAnyValuesInRange<T>, as future refactorings might introduce new subclasses that also should work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, never mind I mis-grepped. But this made me notice you're missing "" to exercise IndexOfEmptyValues.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the case for empty values as well

@MihaZupan
Copy link
Member Author

Failures are #73721 and #79874

@MihaZupan MihaZupan merged commit 5e45fb1 into dotnet:main Dec 30, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jan 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants