rna-transcription: add test to avoid cheesing#2151
Conversation
|
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. For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping |
ellnix
left a comment
There was a problem hiding this comment.
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.
|
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.
|
|
Ah, good digging, thanks. I have a fix prepared. I'll merge this PR later to get the |
07b803f to
fc67952
Compare
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
fc67952 to
5c6a44b
Compare
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
lowerfilter 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