-
-
Notifications
You must be signed in to change notification settings - Fork 83
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 test for Common Lisp - Anagram #847
Conversation
Make the test ignore order of the anagram sets returned.
This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested. If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.
For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping |
Hello. Thanks for opening a PR on Exercism 🙂 We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in. You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch. If you're interested in learning more about this auto-responder, please read this blog post. 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. |
Hello 👋 Thanks for your PR. This repo does not currently have dedicated maintainers. Our cross-track maintainers team will attempt to review and merge your PR, but it will likely take longer for your PR to be reviewed. If you enjoy contributing to Exercism and have a track-record of doing so successfully, you might like to become an Exercism maintainer for this track. Please feel free to ask any questions, or chat to us about anything to do with this PR or the reviewing process on the Exercism forum. (cc @exercism/cross-track-maintainers) |
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.
Solution looks good.
Looks like the instructions of the problem changed about 3 years ago and the tests never updated.
Of course comparing two lists which have no reason to necessarily be in the same order is of course a dumb mistake (one I make in my tests over and over again [sigh]). I usually simply compare two sorted lists, but here since the language has the nicely built in set-exclusive-or
it seems like a good idea.
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.
Previous review got marked 'request changes' by accident. Sorry for the confusion.
Before merging I'll check back on this thread over the next couple days to see who wins the "the track is wrong" vs. "the problem statement is wrong" argument. IMHO, regardless of if the problem statement said 'list' or 'set' the tests are in the wrong comparing two lists which we have no reason to believe would necessarily be sorted in the same order. |
@@ -15,12 +15,15 @@ | |||
;; Define and enter a new FiveAM test-suite | |||
(def-suite* anagram-suite) | |||
|
|||
(defun set-equal-p (set0 set1) | |||
(null (set-exclusive-or set0 set1 :test #'equal))) |
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.
After some thought perhaps #'string-equal
would be good here? As type-checking/documentation that these are unordered collections of strings?
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.
Having reconsidered a little - I think #'equal is a reasonable choice.
Make the test ignore order of the anagram sets returned.
Summary
(Explain what this change is attempting to accomplish)
Checklist
./bin/configlet generate
to ensure all documents are properly generated.