Fix: prevent matching STOP in a valid non-STOP sequence

[Edit: first time bringing a PR to exercism! Sorry if this is lacking context - I’m just figuring things out]

For context, this is for the protein-translation practice exercise. I caught this as I was implementing and realized that some of the community solutions have made the same error. This will likely break existing solutions. :frowning:

When AUG and AUG (also UUA and AUG) are combined, they contain a substring that potentially matches a STOP codon. A naive implementation may falsely match the non-STOP sequence as a STOP codon.

This simple test covers a gap in the current suite.

  AUGAUG
   ^^^ - not a STOP codon

  UUAAUG
   ^^^ - not a STOP codon

fix: prevent matching STOP in a valid non-STOP sequence by barabo · Pull Request #2458 · exercism/problem-specifications · GitHub for reference

This seems like a reasonable addition to me. We don’t want to tailor tests to every implementation and edge case but this seems like it can be a common bug. What do other maintainers think?

1 Like

Seems reasonable to me.

Seems reasonable to me as well.

That’s a quorum of maintainers :slight_smile: That’s good to proceed. Thank you!

Congratulations on the least-controversial Problem Specs PR discussion of all time.

:clap: all round!! :grin:

5 Likes

Approved all around and merged!

2 Likes