Skip to content

Commit 77fffca

Browse files
authored
[rna-transcription] Add a test generator template and regenerate the tests (#421)
[no important files changed]
1 parent c65e101 commit 77fffca

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Before:
2+
unlet! input expected
3+
4+
{%- for case in cases %}
5+
6+
Execute ({{ case.description }}):
7+
let input = {{ case.given | quote }}
8+
let expected = {{ case.expected | quote }}
9+
AssertEqual expected, {{ case.property_function }}(input)
10+
{%- endfor %}
11+
{% set extra_cases = {
12+
"correctly handles invalid input (RNA instead of DNA)": "U",
13+
"correctly handles completely invalid DNA input": "XXX",
14+
"correctly handles partially invalid DNA input": "ACGTXXXCTTAA",
15+
} %}
16+
{%- for description, given in extra_cases.items() %}
17+
Execute ({{ description }}):
18+
let input = {{ given | quote }}
19+
let expected = ''
20+
AssertEqual expected, ToRna(input)
21+
{% endfor %}

‎exercises/practice/rna-transcription/rna_transcription.vader‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
"
2-
" Version: 1.0.1
3-
"
4-
51
Before:
62
unlet! input expected
73

4+
Execute (Empty RNA sequence):
5+
let input = ""
6+
let expected = ""
7+
AssertEqual expected, ToRna(input)
8+
89
Execute (RNA complement of cytosine is guanine):
910
let input = "C"
1011
let expected = "G"
@@ -44,4 +45,3 @@ Execute (correctly handles partially invalid DNA input):
4445
let input = "ACGTXXXCTTAA"
4546
let expected = ''
4647
AssertEqual expected, ToRna(input)
47-

0 commit comments

Comments
 (0)