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

Sort suggestions by match index, then alphabetically #891

Merged
merged 2 commits into from
May 10, 2020

Conversation

kimsey0
Copy link
Contributor

@kimsey0 kimsey0 commented May 7, 2020

Implements suggestion from #12 (comment)

@jonsequitur
Copy link
Contributor

This is a nice solution to #12. Thanks, @kimsey0!

Could you add a unit test that demonstrates the behavior in SuggestionTests? (The tests there currently avoid asserting on the order of the suggestions (e.g. by using BeEquivalentTo), since this wasn't locked down. We have a BeEquivalentSequenceTo extension method which is a convenience for strict ordering.)

@kimsey0
Copy link
Contributor Author

kimsey0 commented May 7, 2020

Sure! Would you like the existing tests to be changed to BeEquivalentSequenceTo too, or just some new tests?

@jonsequitur
Copy link
Contributor

It's good to just add a test. The existing tests are intentionally unconcerned with suggestion order.

@kimsey0
Copy link
Contributor Author

kimsey0 commented May 9, 2020

I've added two tests of suggestions for subcommands, one with text to match and one without. Is this sufficient? I was a bit unsure about the naming, since SuggestionTests seems to contain both Noun_Sentence and Sentence style test names.

@jonsequitur
Copy link
Contributor

This looks great. Thanks, @kimsey0!

@jonsequitur jonsequitur merged commit 011b81c into dotnet:master May 10, 2020
@kimsey0
Copy link
Contributor Author

kimsey0 commented May 10, 2020

Thank you!

@kimsey0 kimsey0 deleted the sort-suggestions-by-match-index branch May 10, 2020 17:51
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

Successfully merging this pull request may close these issues.

2 participants