Sha256: c885c1cfa540702ce7f65e71a0b92bf27f611fc38bcec8944cab3f203d548269

Contents?: true

Size: 655 Bytes

Versions: 86

Compression:

Stored size: 655 Bytes

Contents

package dna

import (
	"reflect"
	"testing"
)

func TestCounts(t *testing.T) {
	for _, tc := range testCases {
		dna := DNA(tc.strand)
		s, err := dna.Counts()
		if tc.errorExpected {
			if err == nil {
				t.Fatalf("FAIL: %s\nCounts(%q)\nExpected error\nActual: %#v",
					tc.description, tc.strand, s)
			}
		} else if err != nil {
			t.Fatalf("FAIL: %s\nCounts(%q)\nExpected: %#v\nGot error: %q",
				tc.description, tc.strand, tc.expected, err)
		} else if !reflect.DeepEqual(s, tc.expected) {
			t.Fatalf("FAIL: %s\nCounts(%q)\nExpected: %#v\nActual: %#v",
				tc.description, tc.strand, tc.expected, s)
		}
		t.Logf("PASS: %s", tc.description)
	}
}

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
trackler-2.2.1.98 tracks/go/exercises/nucleotide-count/nucleotide_count_test.go
trackler-2.2.1.97 tracks/go/exercises/nucleotide-count/nucleotide_count_test.go
trackler-2.2.1.96 tracks/go/exercises/nucleotide-count/nucleotide_count_test.go
trackler-2.2.1.95 tracks/go/exercises/nucleotide-count/nucleotide_count_test.go
trackler-2.2.1.94 tracks/go/exercises/nucleotide-count/nucleotide_count_test.go
trackler-2.2.1.93 tracks/go/exercises/nucleotide-count/nucleotide_count_test.go