-
-
Notifications
You must be signed in to change notification settings - Fork 544
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
Change anagram test case input #2314
Conversation
Hello. Thanks for opening a PR on Exercism. We are currently in a phase of our journey where we have paused community contributions to allow us to take a breather and redesign our community model. You can learn more in this blog post. As such, all issues and PRs in this repository are being automatically closed. That doesn't mean we're not interested in your ideas, or that if you're stuck on something we don't want to help. The best place to discuss things is with our community on the Exercism Community Forum. You can use this link to copy this into a new topic there. Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it. |
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.
This causes the test input to no long match the description, which states that the word is repeated. The new input does not test that, it "merely" checks for case insensitivity, which we already have tests for.
It's true that this change would make this test equivalent to the "words are not anagrams of themselves (case-insensitive)" test. Keeping it as a single string but removing the spaces is another option (the nearest, but not exact, equivalent to this probably is the test case "anagrams must use all letters exactly once"). It could remain as is, but it is a bit weird that this is the only candidate string that has spaces in it, thus making it necessary to account for whitespace in the solution, which doesn't seem to be intended. |
I 100% agree with that. Ideally it should be deprecated, but I don't think we yet have a deprecation option. Not sure what the best option would be |
Changing it from "go Go GO" to "goGoGO" would not make the description invalid and there would be no whitespace. But this PR can be closed without making any changes, if you'd prefer to wait until it is possible to deprecate it. |
That would be perfectly fine with me |
I changed it to a single string without whitespace. |
The final thing left to do is to, instead of mutating the existing test, you create a new test with a |
I just generated a UUID for the new test and pasted it, apparently it should adhere to this pattern '^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ Should I just modify it myself or is there some particular way these are generated? |
|
Thanks, I used configlet for the UUID. |
"candidates": ["goGoGO"] | ||
}, | ||
"expected": [] | ||
}, | ||
{ | ||
"uuid": "9878a1c9-d6ea-4235-ae51-3ea2befd6842", | ||
"description": "anagrams must use all letters exactly once", |
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.
Should we state "all letters of the source word" or something similar?
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.
Isn't that a different test case? I mean, I don't disagree, but it looks like a different test case?
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.
Does that mean that the description, then, is not right in general?
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 so
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.
@kotp Did you mean change "anagrams must use all letters exactly once" to "anagrams must use all letters of the source word exactly once"? As @ErikSchierboom says this is the testcase below. Or did you mean change "does not detect an anagram if the original word is repeated" to "does not detect an anagram if all letters of the source word are repeated"?
If you meant the former, is the description ok as it is now? It currently is "does not detect an anagram if the original word is repeated", which seems to fit the test case even after removing the spaces, since it is the original word being repeated, just without spaces in-between.
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 your change is fine on lines 135-145, so we are really talking about what you have not changed, and may change, as suggested.
Additionally, if you choose not to fix it while we are here, that is OK too. It may be changed at another time, in another pull request.
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.
Well, I must say that your change may be redundant if the following test case is described better. It is not described well at the moment. It may be enforcing the same thing.
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.
It depends on how one looks at it I guess. The original reason for this change was that the existing test is problematic due to the whitespace. I can change the next test's description as suggested if you prefer, or close the pull request and leave the goGoGO test as it is until it can be deprecated/removed completely.
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.
Let's merge this as is and do the update of the other test case in a separate PR.
The input for the anagram function is supposed to be a list containing single word strings, as in all other test cases. This test case has multiple words in the same string, separated by whitespace.