Skip to content

Generate all-your-base armstrong-numbers yacht#558

Open
keiravillekode wants to merge 5 commits into
exercism:mainfrom
keiravillekode:generate-three
Open

Generate all-your-base armstrong-numbers yacht#558
keiravillekode wants to merge 5 commits into
exercism:mainfrom
keiravillekode:generate-three

Conversation

@keiravillekode

Copy link
Copy Markdown
Contributor

Generate tests for

  • all-your-base
  • armstrong-numbers
  • yacht

reject comptime solutions
https://forum.exercism.org/t/zig-track-needs-tests-against-comptime-abuse-and-other-kinds-of-cheating/59830/

@github-actions

Copy link
Copy Markdown
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!

@keiravillekode

Copy link
Copy Markdown
Contributor Author

cc @truly-not-taken

@truly-not-taken

Copy link
Copy Markdown

I do not think we need the new test "empty list - second call returns different memory" in All Your Base exercise. Zig's DebugAllocator already detects invalid free. I can not even trigger the new test because earlier test crashes in panic when I return a pointer to a global array.

Two of new tests in Yacht exercise have misleading descriptions. The "full house three small, two big, alternative order" actually have two small and three big. The "full house two small, three big, alternative order" actually have three small and two big.

All my attempts to cheat with comptime are correctly rejected.

@keiravillekode keiravillekode requested a review from ee7 June 23, 2026 08:55
@keiravillekode

Copy link
Copy Markdown
Contributor Author

The All Your Base test is from #322

I am simply adding a generator, while trying to

  • approximate the existing test suite
  • reject comptime solutions

@keiravillekode

Copy link
Copy Markdown
Contributor Author

Similarly with Yacht I was carrying forward non-canonical tests added in #354

Test descriptions now corrected.

@truly-not-taken

Copy link
Copy Markdown

I have managed to trigger the All Your Base test "empty list - second call returns different memory". I take back all criticism. This is a good test.

Yacht test descriptions are good now.

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