Skip to content

Add a test for IndexOfAnyValues.GetValues - #80038

Merged
MihaZupan merged 2 commits into
dotnet:mainfrom
MihaZupan:indexofanyvalues-getvaluestest
Dec 30, 2022
Merged

MihaZupan merged 2 commits into
dotnet:mainfrom
MihaZupan:indexofanyvalues-getvaluestest

Conversation

@MihaZupan

Copy link
Copy Markdown
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

ghost commented Dec 29, 2022

Copy link
Copy Markdown

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

{
public static partial class SpanTests
{
private static readonly Func<IndexOfAnyValues<byte>, byte[]> s_getValuesByteMethod =

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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