Skip to content

rna-transcription: add test to avoid cheesing#2151

Merged
senekor merged 1 commit into
mainfrom
senekor/yzuopuqqpkrw
Jul 1, 2026
Merged

rna-transcription: add test to avoid cheesing#2151
senekor merged 1 commit into
mainfrom
senekor/yzuopuqqpkrw

Conversation

@senekor

@senekor senekor commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

In the normal tests for this exercise, we compare two RNA instances. If the user defines RNA as an empty struct, those instances will always compare equal. This is prevented with the new test to make sure different RNA don't compare equal.

I had to add the lower filter to keep the test identifiers stable. It seems the template and the generated tests have drifted a bit. I'll have to investigate and fix that in a separate patch.

Forum post:
https://forum.exercism.org/t/successful-null-solution-for-rna-transcription/63064

@github-actions

github-actions Bot commented Jul 1, 2026

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!

@senekor senekor requested a review from ellnix July 1, 2026 17:38

@ellnix ellnix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's a very funny solution, but this exercise sure doesn't have a lot of tests upstream. I suppose the structs being empty was just one way in an entire universe of cheese since you could implement PartialEq however you like.

@ellnix

ellnix commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

I went through and checked why the test template generation changed, it seems like the POV exercise had properties that were camel cased, and you (I think) added a helper in makeident to turn them into snake cased first. The commit:

4e6346b#diff-6e99d847a66783ee3d4d58d400532ee97bbb6e357026c274bef49cbb8db370b9 from #2094

Perhaps converting camel cased to snake cased can be its own filter? That way you could apply it selectively to avoid causing issues for exercises like this one.

exercises/practice/pov/.meta/test_template.tera:47

{{ test_group.cases[0].property | make_ident }}

@senekor

senekor commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Ah, good digging, thanks. I have a fix prepared. I'll merge this PR later to get the | lower out of the diff.

@senekor senekor force-pushed the senekor/yzuopuqqpkrw branch from 07b803f to fc67952 Compare July 1, 2026 19:53
In the normal tests for this exercise, we compare two RNA instances.
If the user defines RNA as an empty struct, those instances will
always compare equal. This is prevented with the new test to make sure
different RNA don't compare equal.

Forum post:
https://forum.exercism.org/t/successful-null-solution-for-rna-transcription/63064
@senekor senekor force-pushed the senekor/yzuopuqqpkrw branch from fc67952 to 5c6a44b Compare July 1, 2026 19:54
@senekor senekor merged commit f254d21 into main Jul 1, 2026
10 checks passed
@senekor senekor deleted the senekor/yzuopuqqpkrw branch July 1, 2026 20: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