Skip to content

Sort completions result in TabcompleteTests #5752

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

Merged
merged 1 commit into from
Jan 19, 2019

Conversation

allanrenucci
Copy link
Contributor

This will make the test deterministic.

This will make the test deterministic.
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

I am still mystified. I would have thought that the new version is equivalent to the old one. What changes?

@allanrenucci
Copy link
Contributor Author

I am still mystified. I would have thought that the new version is equivalent to the old one. What changes?

The test that fails in #5458 did not sort the results. Only a subset of the tests sorted the results in the old version. Now we sort the results for all the tests

@@ -8,7 +8,7 @@ class TabcompleteTests extends ReplTest {

/** Returns the `(<instance completions>, <companion completions>)`*/
private[this] def tabComplete(src: String)(implicit state: State): List[String] =
completions(src.length, src, state).map(_.value)
completions(src.length, src, state).map(_.value).sorted
Copy link
Member

Choose a reason for hiding this comment

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

I think we might as well make completions return a sorted result.

Copy link
Contributor Author

@allanrenucci allanrenucci Jan 19, 2019

Choose a reason for hiding this comment

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

JLine has its own mechanism to sort completions. So it doesn't matter if you sort the completion result in the first place

@allanrenucci allanrenucci merged commit c2542c2 into scala:master Jan 19, 2019
@allanrenucci allanrenucci deleted the tabcomplete-test branch January 19, 2019 22:15
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.

3 participants