forked from exercism/problem-specifications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcanonical-data.json
92 lines (92 loc) · 2.8 KB
/
canonical-data.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{
"exercise": "nucleotide-count",
"comments": [
"Given a string of nucleotides, the count of each nucleotide is returned.",
"",
"It is the track's responsibility to add further language specific tests like:",
"input error handling (null/undefined parameters etc.)",
"referential transparency (i.e. evaluating, a function/method gives the same value for same arguments every time.)",
"",
"'error' and 'null' should be treated according to the languages' specifics and possibilities."
],
"version": "1.1.0",
"cases": [
{
"description": "counts all nucleotides in a provided strand.",
"comments": [
"nucleotideCounts counts all DNA-nucleotides in the input strand and returns an object with properties",
"A, C, G and T holding their respective amounts."
],
"cases": [
{
"description": "returns zeroes in case of an empty input strand.",
"property": "nucleotideCounts",
"strand": "",
"expected": {
"A": 0,
"C": 0,
"G": 0,
"T": 0
}
},
{
"description": "can count one nucleotide in single-character input.",
"property": "nucleotideCounts",
"strand": "G",
"expected": {
"A": 0,
"C": 0,
"G": 1,
"T": 0
}
},
{
"description": "can count one nucleotide in multi-character input.",
"property": "nucleotideCounts",
"strand": "GGGGGGG",
"expected": {
"A": 0,
"C": 0,
"G": 7,
"T": 0
}
},
{
"description": "can count all nucleotides in a strand containing all nucleotides.",
"property": "nucleotideCounts",
"strand": "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC",
"expected": {
"A": 20,
"C": 12,
"G": 17,
"T": 21
}
},
{
"description": "ignores case in a strand of mixed-case nucleotides.",
"property": "nucleotideCounts",
"strand": "aGcTtTtCaTtCtGaCtGcAaCgGgCaAtAtGtCtCtGtGtGgAtTaAaAaAaGaGtGtCtGaTaGcAgC",
"expected": {
"A": 20,
"C": 12,
"G": 17,
"T": 21
}
},
{
"description": "handles incorrect inputs.",
"cases": [
{
"description": "treats an input with anything else than ACGT-characters as error.",
"property": "nucleotideCounts",
"strand": "AGUU1+ :'A'}CT",
"expected": {
"error": "Invalid nucleotide in strand"
}
}
]
}
]
}
]
}