Skip to content

Commit c4b4c62

Browse files
Sync protein-translation test (#246)
1 parent 2fa73d4 commit c4b4c62

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,16 @@ description = "Translation stops if STOP codon in middle of three-codon sequence
8080
[2c2a2a60-401f-4a80-b977-e0715b23b93d]
8181
description = "Translation stops if STOP codon in middle of six-codon sequence"
8282

83+
[f6f92714-769f-4187-9524-e353e8a41a80]
84+
description = "Sequence of two non-STOP codons does not translate to a STOP codon"
85+
8386
[1e75ea2a-f907-4994-ae5c-118632a1cb0f]
8487
description = "Non-existing codon can't translate"
88+
include = false
8589

8690
[9eac93f3-627a-4c90-8653-6d0a0595bc6f]
8791
description = "Unknown amino acids, not part of a codon, can't translate"
92+
reimplements = "1e75ea2a-f907-4994-ae5c-118632a1cb0f"
8893

8994
[9d73899f-e68e-4291-b1e2-7bf87c00f024]
9095
description = "Incomplete RNA sequence can't translate"

exercises/practice/protein-translation/run_test.v

+2-6
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,8 @@ fn test_translation_stops_if_stop_codon_in_middle_of_six_codon_sequence() {
104104
assert proteins('UGGUGUUAUUAAUGGUUU')! == ['Tryptophan', 'Cysteine', 'Tyrosine']
105105
}
106106

107-
fn test_non_existing_codon_cant_translate() {
108-
if res := proteins('AAA') {
109-
assert false, "Non-existing codon can't translate should return an error"
110-
} else {
111-
assert err.msg() == 'Invalid codon'
112-
}
107+
fn test_sequence_of_two_non_stop_codons_does_not_translate_to_a_stop_codon() {
108+
assert proteins('AUGAUG')! == ['Methionine', 'Methionine']
113109
}
114110

115111
fn test_unknown_amino_acids_not_part_of_a_codon_cant_translate() {

0 commit comments

Comments
 (0)