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

Eagerly detect sortable types for equivalency tests in 3.13.x #4007

Merged
merged 2 commits into from
Mar 20, 2022

Conversation

stevenaw
Copy link
Member

Fixes #3998

This turned out much simpler than I expected. This PR will eagerly determine if an array can be sorted without issue for equivalency tests. This PR targets 3.13, but I'll cherry-pick the commits to 4.0 once the implementation is finalized.

if (TypeHelper.IsTuple(type) || TypeHelper.IsValueTuple(type))
{
foreach (var typeArg in type.GetGenericArguments())
if (!typeArg.IsSortable())
Copy link
Member Author

Choose a reason for hiding this comment

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

Recursively check + confirm that all of a tuple's properties can reasonably be expected to be sortable.

@stevenaw stevenaw marked this pull request as ready for review November 27, 2021 03:04
Copy link
Member

@manfred-brands manfred-brands left a comment

Choose a reason for hiding this comment

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

Looks good.
Good example of recursion making things simple.

Copy link
Member

@rprouse rprouse left a comment

Choose a reason for hiding this comment

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

Nice

@rprouse rprouse merged commit c32c2e4 into nunit:v3.13-dev Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants