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 test for Common Lisp - Anagram #847

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

brasse
Copy link
Contributor

@brasse brasse commented Jan 14, 2025

Make the test ignore order of the anagram sets returned.

Summary

(Explain what this change is attempting to accomplish)

Checklist

  • If docs where changed run ./bin/configlet generate to ensure all documents are properly generated.
  • CI is green

Make the test ignore order of the anagram sets returned.
Copy link

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.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

Copy link

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.

@github-actions github-actions bot closed this Jan 14, 2025
Copy link

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)

@iHiD iHiD reopened this Jan 14, 2025
Copy link
Member

@verdammelt verdammelt left a 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.

Copy link
Member

@verdammelt verdammelt left a 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.

@verdammelt
Copy link
Member

Forum thread

https://forum.exercism.org/t/whats-the-process-to-follow-if-i-find-an-exercise-where-the-instructions-are-wrong-or-misleading/14816

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.

@verdammelt verdammelt added x:action/fix Fix an issue x:action/improve Improve existing functionality/content x:action/sync Sync content with its latest version x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:type/coding Write code that is not student-facing content (e.g. test-runners, generators, but not exercises) x:size/small Small amount of work x:rep/small Small amount of reputation labels Jan 15, 2025
@@ -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)))
Copy link
Member

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?

Copy link
Member

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.

@verdammelt verdammelt merged commit 2e3b1a6 into exercism:main Jan 26, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:action/fix Fix an issue x:action/improve Improve existing functionality/content x:action/sync Sync content with its latest version x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:rep/small Small amount of reputation x:size/small Small amount of work x:type/coding Write code that is not student-facing content (e.g. test-runners, generators, but not exercises)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants