Sha256: f87ae1e4f4110d370dca27fe7d332974ac0162713618411f389f62c6c7dcec70

Contents?: true

Size: 1.02 KB

Versions: 86

Compression:

Stored size: 1.02 KB

Contents

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,
	},
}

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.179 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.178 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.177 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.176 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.175 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.174 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.173 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.172 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.171 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.170 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.169 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.167 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.166 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.165 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.164 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.163 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.162 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.161 tracks/go/exercises/nucleotide-count/cases_test.go
trackler-2.2.1.160 tracks/go/exercises/nucleotide-count/cases_test.go