diff --git a/exercises/practice/protein-translation/.meta/tests.toml b/exercises/practice/protein-translation/.meta/tests.toml index 02a54c34..a5e66047 100644 --- a/exercises/practice/protein-translation/.meta/tests.toml +++ b/exercises/practice/protein-translation/.meta/tests.toml @@ -1,6 +1,16 @@ -# This is an auto-generated file. Regular comments will be removed when this -# file is regenerated. Regenerating will not touch any manually added keys, -# so comments can be added in a "comment" key. +# This is an auto-generated file. +# +# Regenerating this file via `configlet sync` will: +# - Recreate every `description` key/value pair +# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications +# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) +# - Preserve any other key/value pair +# +# As user-added comments (using the # character) will be removed when this file +# is regenerated, comments can be added via a `comment` key. + +[2c44f7bf-ba20-43f7-a3bf-f2219c0c3f98] +description = "Empty RNA sequence results in no proteins" [96d3d44f-34a2-4db4-84cd-fff523e069be] description = "Methionine RNA sequence" @@ -53,6 +63,12 @@ description = "STOP codon RNA sequence 2" [9c2ad527-ebc9-4ace-808b-2b6447cb54cb] description = "STOP codon RNA sequence 3" +[f4d9d8ee-00a8-47bf-a1e3-1641d4428e54] +description = "Sequence of two protein codons translates into proteins" + +[dd22eef3-b4f1-4ad6-bb0b-27093c090a9d] +description = "Sequence of two different protein codons translates into proteins" + [d0f295df-fb70-425c-946c-ec2ec185388e] description = "Translate RNA strand into correct protein list" @@ -70,3 +86,6 @@ description = "Translation stops if STOP codon in middle of three-codon sequence [2c2a2a60-401f-4a80-b977-e0715b23b93d] description = "Translation stops if STOP codon in middle of six-codon sequence" + +[f6f92714-769f-4187-9524-e353e8a41a80] +description = "Sequence of two non-STOP codons does not translate to a STOP codon" diff --git a/exercises/practice/protein-translation/protein_translation_test.cpp b/exercises/practice/protein-translation/protein_translation_test.cpp index 76bb9a83..54e28aa7 100644 --- a/exercises/practice/protein-translation/protein_translation_test.cpp +++ b/exercises/practice/protein-translation/protein_translation_test.cpp @@ -91,6 +91,20 @@ TEST_CASE("Translate_RNA_strand_into_correct_protein_list") { protein_translation::proteins("AUGUUUUGG")); } +TEST_CASE("Sequence_of_two_protein_codons_translates_into_proteins") { + REQUIRE(vector{"Phenylalanine", "Phenylalanine"} == + protein_translation::proteins("UUUUUU")); +} + +TEST_CASE("Sequence_of_two_different_protein_codons_translates_into_proteins") { + REQUIRE(vector{"Leucine", "Leucine"} == + protein_translation::proteins("UUAUUG")); +} + +TEST_CASE("Empty_RNA_sequence_results_in_no_proteins") { + REQUIRE(vector{} == protein_translation::proteins("")); +} + TEST_CASE("Translation_stops_if_STOP_codon_at_beginning_of_sequence") { REQUIRE(vector{} == protein_translation::proteins("UAGUGG")); } @@ -115,4 +129,10 @@ TEST_CASE("Translation_stops_if_STOP_codon_in_middle_of_six-codon_sequence") { protein_translation::proteins("UGGUGUUAUUAAUGGUUU")); } +TEST_CASE( + "Sequence_of_two_non-STOP_codons_does_not_translate_to_a_STOP_codon") { + REQUIRE(vector{"Methionine", "Methionine"} == + protein_translation::proteins("AUGAUG")); +} + #endif // !EXERCISM_RUN_ALL_TESTS