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

Anagram - Allow results in any order #531

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

ryanplusplus
Copy link
Member

No description provided.

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!

end

local function assert_lists_are_same(expected, actual)
assert.are.same(sorted_clone(expected), sorted_clone(actual))
Copy link
Contributor

Choose a reason for hiding this comment

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

Could possibly check lengths are the same before sorting.

@@ -1,59 +1,72 @@
local Anagram = require('anagram')

describe('anagram', function()
local function sorted_clone(t)
local clone = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Too bad there's not a table.unpack equivalent for associative arrays.

@glennj glennj merged commit beeafd0 into main Jan 17, 2025
5 checks passed
@glennj glennj deleted the allow-anagram-results-to-have-arbitrary-order branch January 17, 2025 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants