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

Fix REPL test result uniqueness #32446

Closed
wants to merge 1 commit into from
Closed

Conversation

Moelf
Copy link
Contributor

@Moelf Moelf commented Jun 28, 2019

Fixes #32377

Makes the behavior match whats in production code? Since REPL can come from Package and module.

return unique!(map(completion_text, ret)), partial[range], should_complete

@@ -87,7 +87,7 @@ end

function map_completion_text(completions)
c, r, res = completions
return map(completion_text, c), r, res
return unique!(map(completion_text, c)), r, res
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 one of the intents of this test is to make sure that the completions aren't returning non-unique duplicates

Copy link
Member

Choose a reason for hiding this comment

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

The completions can have duplicates which is why we call unique! on it in the REPL code itself, #28692, #28694.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, and this is the test you added in #28694 to check that the list does not have duplicates

Copy link
Member

@KristofferC KristofferC Jun 28, 2019

Choose a reason for hiding this comment

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

The test added there assumes that test_completion does the same as complete_line. However, right now, only complete_line does the unique! call. So the test is at least faulty with the current map_completion_text.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I can see that with this change, the count( ...) == 1 part is obsolete.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that is right. The way things are written now, it is a bit hard to test this properly.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think one of the intents of this test is to make sure that the completions aren't returning non-unique duplicates

Why would that be a problem ?

@kshyatt kshyatt added REPL Julia's REPL (Read Eval Print Loop) test This change adds or pertains to unit tests labels Jul 25, 2019
@Moelf
Copy link
Contributor Author

Moelf commented Aug 6, 2019

bump

@StefanKarpinski StefanKarpinski added the forget me not PRs that one wants to make sure aren't forgotten label Aug 7, 2019
@tgflynn
Copy link
Contributor

tgflynn commented Sep 5, 2019

Doesn't the REPL always obtain completions through complete_line (where the uniqueness problem was fixed in PR #28694) ?

If that's the case then it seems like either this PR should be merged to make this test work like complete_line or this test should be removed completely and replaced by a test for complete_line.

@tgflynn
Copy link
Contributor

tgflynn commented Sep 5, 2019

The weird thing about PR #28694 is that it only changed code in complete_line but the test it adds doesn't test complete_line.

@KristofferC KristofferC closed this Sep 6, 2019
@KristofferC KristofferC reopened this Sep 6, 2019
@Moelf
Copy link
Contributor Author

Moelf commented Jun 16, 2020

is this still relevant?

@KristofferC
Copy link
Member

Yes, let's re-run CI and merge this.

@KristofferC KristofferC reopened this Jun 29, 2020
@vtjnash
Copy link
Member

vtjnash commented Jun 29, 2020

I think we can't merge this as-is since it defeats the purpose of the existence of this test. We either need to delete this test (and reopen #26930), or figure out how to fix and/or test it properly.

@vtjnash
Copy link
Member

vtjnash commented Jul 6, 2020

Superseded by #36506

@simeonschaub simeonschaub removed the forget me not PRs that one wants to make sure aren't forgotten label May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REPL Julia's REPL (Read Eval Print Loop) test This change adds or pertains to unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Base.runtests("REPL") fails, but not when run together with some other testset
7 participants