diff options
author | Andinus <andinus@nand.sh> | 2021-08-11 15:26:15 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2021-08-11 15:26:15 +0530 |
commit | 321825828ac918bad28d0597a8616c6dc9802c3c (patch) | |
tree | 0b8e9cb1012197750eb58e972736319b2a6abac2 /go/nucleotide-count/cases_test.go | |
parent | 2979ef790ac5b8f58495e0dd08cafd6a3a2e30a5 (diff) | |
download | exercism-321825828ac918bad28d0597a8616c6dc9802c3c.tar.gz |
Add solved exercises
Diffstat (limited to 'go/nucleotide-count/cases_test.go')
-rw-r--r-- | go/nucleotide-count/cases_test.go | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/go/nucleotide-count/cases_test.go b/go/nucleotide-count/cases_test.go new file mode 100644 index 0000000..98d5cac --- /dev/null +++ b/go/nucleotide-count/cases_test.go @@ -0,0 +1,39 @@ +package dna + +// Source: exercism/problem-specifications +// Commit: 879a096 nucleotide-count: Apply new "input" policy +// Problem Specifications Version: 1.3.0 + +// count all nucleotides in a strand +var testCases = []struct { + description string + strand string + expected Histogram + errorExpected bool +}{ + { + description: "empty strand", + strand: "", + expected: Histogram{'A': 0, 'C': 0, 'G': 0, 'T': 0}, + }, + { + description: "can count one nucleotide in single-character input", + strand: "G", + expected: Histogram{'A': 0, 'C': 0, 'G': 1, 'T': 0}, + }, + { + description: "strand with repeated nucleotide", + strand: "GGGGGGG", + expected: Histogram{'A': 0, 'C': 0, 'G': 7, 'T': 0}, + }, + { + description: "strand with multiple nucleotides", + strand: "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC", + expected: Histogram{'A': 20, 'C': 12, 'G': 17, 'T': 21}, + }, + { + description: "strand with invalid nucleotides", + strand: "AGXXACT", + errorExpected: true, + }, +} |