From 54d80f383633bd22491b331c91a5698fa570825e Mon Sep 17 00:00:00 2001 From: Carl Anderson Date: Mon, 24 Jun 2024 12:32:30 -0500 Subject: [PATCH 1/2] fix: prevent matching STOP in a valid non-STOP sequence 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. --- exercises/protein-translation/canonical-data.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/exercises/protein-translation/canonical-data.json b/exercises/protein-translation/canonical-data.json index 574b10d789..ad3691e07f 100644 --- a/exercises/protein-translation/canonical-data.json +++ b/exercises/protein-translation/canonical-data.json @@ -242,6 +242,15 @@ }, "expected": ["Tryptophan", "Cysteine", "Tyrosine"] }, + { + "uuid": "f6f92714-769f-4187-9524-e353e8a41a80", + "description": "Sequence of two non-STOP codons is not matched to a STOP codon", + "property": "proteins", + "input": { + "strand": "AUGAUG" + }, + "expected": ["Methionine", "Methionine"] + }, { "uuid": "1e75ea2a-f907-4994-ae5c-118632a1cb0f", "description": "Non-existing codon can't translate", From 058db555f783414b4f138db494afc1351b7bf2c1 Mon Sep 17 00:00:00 2001 From: Carl Anderson Date: Mon, 24 Jun 2024 14:10:24 -0500 Subject: [PATCH 2/2] fix: wording for consistency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: AndrĂ¡s B Nagy <20251272+BNAndras@users.noreply.github.com> --- exercises/protein-translation/canonical-data.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/protein-translation/canonical-data.json b/exercises/protein-translation/canonical-data.json index ad3691e07f..1285da4402 100644 --- a/exercises/protein-translation/canonical-data.json +++ b/exercises/protein-translation/canonical-data.json @@ -244,7 +244,7 @@ }, { "uuid": "f6f92714-769f-4187-9524-e353e8a41a80", - "description": "Sequence of two non-STOP codons is not matched to a STOP codon", + "description": "Sequence of two non-STOP codons does not translate to a STOP codon", "property": "proteins", "input": { "strand": "AUGAUG"