-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Conversation
@@ -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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
bump |
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. |
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. |
is this still relevant? |
Yes, let's re-run CI and merge this. |
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. |
Superseded by #36506 |
Fixes #32377
Makes the behavior match whats in production code? Since
REPL
can come from Package and module.julia/stdlib/REPL/src/REPL.jl
Line 363 in 67cdc55