Skip to content

Commit ec14dfa

Browse files
IsaacGvaeng
andauthored
Sync tests for exercise/practice/protein-translation (#961)
* Sync tests for exercise/practice/protein-translation * added uuids --------- Co-authored-by: vaeng <[email protected]>
1 parent 70c4703 commit ec14dfa

File tree

2 files changed

+79
-26
lines changed

2 files changed

+79
-26
lines changed

exercises/practice/protein-translation/.meta/tests.toml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
# This is an auto-generated file. Regular comments will be removed when this
2-
# file is regenerated. Regenerating will not touch any manually added keys,
3-
# so comments can be added in a "comment" key.
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
11+
12+
[2c44f7bf-ba20-43f7-a3bf-f2219c0c3f98]
13+
description = "Empty RNA sequence results in no proteins"
414

515
[96d3d44f-34a2-4db4-84cd-fff523e069be]
616
description = "Methionine RNA sequence"
@@ -53,6 +63,12 @@ description = "STOP codon RNA sequence 2"
5363
[9c2ad527-ebc9-4ace-808b-2b6447cb54cb]
5464
description = "STOP codon RNA sequence 3"
5565

66+
[f4d9d8ee-00a8-47bf-a1e3-1641d4428e54]
67+
description = "Sequence of two protein codons translates into proteins"
68+
69+
[dd22eef3-b4f1-4ad6-bb0b-27093c090a9d]
70+
description = "Sequence of two different protein codons translates into proteins"
71+
5672
[d0f295df-fb70-425c-946c-ec2ec185388e]
5773
description = "Translate RNA strand into correct protein list"
5874

@@ -70,3 +86,6 @@ description = "Translation stops if STOP codon in middle of three-codon sequence
7086

7187
[2c2a2a60-401f-4a80-b977-e0715b23b93d]
7288
description = "Translation stops if STOP codon in middle of six-codon sequence"
89+
90+
[f6f92714-769f-4187-9524-e353e8a41a80]
91+
description = "Sequence of two non-STOP codons does not translate to a STOP codon"

exercises/practice/protein-translation/protein_translation_test.cpp

Lines changed: 57 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,107 +12,141 @@ using namespace std;
1212

1313
// Secret-handshake exercise test case data version 1.2.1
1414

15-
TEST_CASE("Methionine_RNA_sequence") {
15+
TEST_CASE("Methionine RNA sequence", "[96d3d44f-34a2-4db4-84cd-fff523e069be]") {
1616
REQUIRE(vector<string>{"Methionine"} ==
1717
protein_translation::proteins("AUG"));
1818
}
1919

2020
#if defined(EXERCISM_RUN_ALL_TESTS)
2121

22-
TEST_CASE("Phenylalanine_RNA_sequence_1") {
22+
TEST_CASE("Phenylalanine RNA sequence 1",
23+
"[1b4c56d8-d69f-44eb-be0e-7b17546143d9]") {
2324
REQUIRE(vector<string>{"Phenylalanine"} ==
2425
protein_translation::proteins("UUU"));
2526
}
2627

27-
TEST_CASE("Phenylalanine_RNA_sequence_2") {
28+
TEST_CASE("Phenylalanine RNA sequence 2",
29+
"[81b53646-bd57-4732-b2cb-6b1880e36d11]") {
2830
REQUIRE(vector<string>{"Phenylalanine"} ==
2931
protein_translation::proteins("UUC"));
3032
}
3133

32-
TEST_CASE("Leucine_RNA_sequence_1") {
34+
TEST_CASE("Leucine RNA sequence 1", "[42f69d4f-19d2-4d2c-a8b0-f0ae9ee1b6b4]") {
3335
REQUIRE(vector<string>{"Leucine"} == protein_translation::proteins("UUA"));
3436
}
3537

36-
TEST_CASE("Leucine_RNA_sequence_2") {
38+
TEST_CASE("Leucine RNA sequence 2", "[ac5edadd-08ed-40a3-b2b9-d82bb50424c4]") {
3739
REQUIRE(vector<string>{"Leucine"} == protein_translation::proteins("UUG"));
3840
}
3941

40-
TEST_CASE("Serine_RNA_sequence_1") {
42+
TEST_CASE("Serine RNA sequence 1", "[8bc36e22-f984-44c3-9f6b-ee5d4e73f120]") {
4143
REQUIRE(vector<string>{"Serine"} == protein_translation::proteins("UCU"));
4244
}
4345

44-
TEST_CASE("Serine_RNA_sequence_2") {
46+
TEST_CASE("Serine RNA sequence 2", "[5c3fa5da-4268-44e5-9f4b-f016ccf90131]") {
4547
REQUIRE(vector<string>{"Serine"} == protein_translation::proteins("UCC"));
4648
}
4749

48-
TEST_CASE("Serine_RNA_sequence_3") {
50+
TEST_CASE("Serine RNA sequence 3", "[00579891-b594-42b4-96dc-7ff8bf519606]") {
4951
REQUIRE(vector<string>{"Serine"} == protein_translation::proteins("UCA"));
5052
}
5153

52-
TEST_CASE("Serine_RNA_sequence_4") {
54+
TEST_CASE("Serine RNA sequence 4", "[08c61c3b-fa34-4950-8c4a-133945570ef6]") {
5355
REQUIRE(vector<string>{"Serine"} == protein_translation::proteins("UCG"));
5456
}
5557

56-
TEST_CASE("Tyrosine_RNA_sequence_1") {
58+
TEST_CASE("Tyrosine RNA sequence 1", "[54e1e7d8-63c0-456d-91d2-062c72f8eef5]") {
5759
REQUIRE(vector<string>{"Tyrosine"} == protein_translation::proteins("UAU"));
5860
}
5961

60-
TEST_CASE("Tyrosine_RNA_sequence_2") {
62+
TEST_CASE("Tyrosine RNA sequence 2", "[47bcfba2-9d72-46ad-bbce-22f7666b7eb1]") {
6163
REQUIRE(vector<string>{"Tyrosine"} == protein_translation::proteins("UAC"));
6264
}
6365

64-
TEST_CASE("Cysteine_RNA_sequence_1") {
66+
TEST_CASE("Cysteine RNA sequence 1", "[3a691829-fe72-43a7-8c8e-1bd083163f72]") {
6567
REQUIRE(vector<string>{"Cysteine"} == protein_translation::proteins("UGU"));
6668
}
6769

68-
TEST_CASE("Cysteine_RNA_sequence_2") {
70+
TEST_CASE("Cysteine RNA sequence 2", "[1b6f8a26-ca2f-43b8-8262-3ee446021767]") {
6971
REQUIRE(vector<string>{"Cysteine"} == protein_translation::proteins("UGC"));
7072
}
7173

72-
TEST_CASE("Tryptophan_RNA_sequence") {
74+
TEST_CASE("Tryptophan RNA sequence", "[1e91c1eb-02c0-48a0-9e35-168ad0cb5f39]") {
7375
REQUIRE(vector<string>{"Tryptophan"} ==
7476
protein_translation::proteins("UGG"));
7577
}
7678

77-
TEST_CASE("STOP_codon_RNA_sequence_1") {
79+
TEST_CASE("STOP codon RNA sequence 1",
80+
"[e547af0b-aeab-49c7-9f13-801773a73557]") {
7881
REQUIRE(vector<string>{} == protein_translation::proteins("UAA"));
7982
}
8083

81-
TEST_CASE("STOP_codon_RNA_sequence_2") {
84+
TEST_CASE("STOP codon RNA sequence 2",
85+
"[67640947-ff02-4f23-a2ef-816f8a2ba72e]") {
8286
REQUIRE(vector<string>{} == protein_translation::proteins("UAG"));
8387
}
8488

85-
TEST_CASE("STOP_codon_RNA_sequence_3") {
89+
TEST_CASE("STOP codon RNA sequence 3",
90+
"[9c2ad527-ebc9-4ace-808b-2b6447cb54cb]") {
8691
REQUIRE(vector<string>{} == protein_translation::proteins("UGA"));
8792
}
8893

89-
TEST_CASE("Translate_RNA_strand_into_correct_protein_list") {
94+
TEST_CASE("Translate RNA strand into correct protein list",
95+
"[d0f295df-fb70-425c-946c-ec2ec185388e]") {
9096
REQUIRE(vector<string>{"Methionine", "Phenylalanine", "Tryptophan"} ==
9197
protein_translation::proteins("AUGUUUUGG"));
9298
}
9399

94-
TEST_CASE("Translation_stops_if_STOP_codon_at_beginning_of_sequence") {
100+
TEST_CASE("Sequence of two protein codons translates into proteins",
101+
"[f4d9d8ee-00a8-47bf-a1e3-1641d4428e54]") {
102+
REQUIRE(vector<string>{"Phenylalanine", "Phenylalanine"} ==
103+
protein_translation::proteins("UUUUUU"));
104+
}
105+
106+
TEST_CASE("Sequence of two different protein codons translates into proteins",
107+
"[dd22eef3-b4f1-4ad6-bb0b-27093c090a9d]") {
108+
REQUIRE(vector<string>{"Leucine", "Leucine"} ==
109+
protein_translation::proteins("UUAUUG"));
110+
}
111+
112+
TEST_CASE("Empty RNA sequence results in no proteins",
113+
"[2c44f7bf-ba20-43f7-a3bf-f2219c0c3f98]") {
114+
REQUIRE(vector<string>{} == protein_translation::proteins(""));
115+
}
116+
117+
TEST_CASE("Translation stops if STOP codon at beginning of sequence",
118+
"[e30e8505-97ec-4e5f-a73e-5726a1faa1f4]") {
95119
REQUIRE(vector<string>{} == protein_translation::proteins("UAGUGG"));
96120
}
97121

98-
TEST_CASE("Translation_stops_if_STOP_codon_at_end_of_two-codon_sequence") {
122+
TEST_CASE("Translation stops if STOP codon at end of two-codon sequence",
123+
"[5358a20b-6f4c-4893-bce4-f929001710f3]") {
99124
REQUIRE(vector<string>{"Tryptophan"} ==
100125
protein_translation::proteins("UGGUAG"));
101126
}
102127

103-
TEST_CASE("Translation_stops_if_STOP_codon_at_end_of_three-codon_sequence") {
128+
TEST_CASE("Translation stops if STOP codon at end of three-codon sequence",
129+
"[ba16703a-1a55-482f-bb07-b21eef5093a3]") {
104130
REQUIRE(vector<string>{"Methionine", "Phenylalanine"} ==
105131
protein_translation::proteins("AUGUUUUAA"));
106132
}
107133

108-
TEST_CASE("Translation_stops_if_STOP_codon_in_middle_of_three-codon_sequence") {
134+
TEST_CASE("Translation stops if STOP codon in middle of three-codon sequence",
135+
"[4089bb5a-d5b4-4e71-b79e-b8d1f14a2911]") {
109136
REQUIRE(vector<string>{"Tryptophan"} ==
110137
protein_translation::proteins("UGGUAGUGG"));
111138
}
112139

113-
TEST_CASE("Translation_stops_if_STOP_codon_in_middle_of_six-codon_sequence") {
140+
TEST_CASE("Translation stops if STOP codon in middle of six-codon sequence",
141+
"[2c2a2a60-401f-4a80-b977-e0715b23b93d]") {
114142
REQUIRE(vector<string>{"Tryptophan", "Cysteine", "Tyrosine"} ==
115143
protein_translation::proteins("UGGUGUUAUUAAUGGUUU"));
116144
}
117145

146+
TEST_CASE("Sequence of two non-STOP codons does not translate to a STOP codon",
147+
"[f6f92714-769f-4187-9524-e353e8a41a80]") {
148+
REQUIRE(vector<string>{"Methionine", "Methionine"} ==
149+
protein_translation::proteins("AUGAUG"));
150+
}
151+
118152
#endif // !EXERCISM_RUN_ALL_TESTS

0 commit comments

Comments
 (0)