Skip to content

Sync perfect-numbers#628

Merged
ryanplusplus merged 1 commit intomainfrom
sync-perfect-numbers
Feb 15, 2026
Merged

Sync perfect-numbers#628
ryanplusplus merged 1 commit intomainfrom
sync-perfect-numbers

Conversation

@ryanplusplus
Copy link
Member

Closes #626

@github-actions
Copy link
Contributor

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!

Comment on lines +9 to 20
local grades = {}
for grade, _ in pairs(self.db) do
table.insert(grades, grade)
end
table.sort(grades)

local roster = {}
for _, grade in pairs(self.db) do
for _, student in ipairs(grade) do
for _, grade in ipairs(grades) do
for _, student in ipairs(self.db[grade]) do
table.insert(roster, student)
end
end
Copy link
Member Author

Choose a reason for hiding this comment

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

The previous solution could fail if pairs didn't iterate over self.db in the right order (which isn't guaranteed). This addresses an intermittent failure related to sensitivity in the iteration order by guaranteeing that we will always iterate over all grades in ascending order.

Comment on lines -22 to +24
return { aliquot_sum = aliquot_sum, classify = classify }
return { classify = classify }
Copy link
Member Author

Choose a reason for hiding this comment

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

The tests no longer test aliquot_sum directly

@ryanplusplus ryanplusplus merged commit 7520248 into main Feb 15, 2026
3 checks passed
@ryanplusplus ryanplusplus deleted the sync-perfect-numbers branch February 15, 2026 03:04
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.

🚨 configlet sync --test found unsynced tests

2 participants