MCPcopy Create free account
hub / github.com/Koeng101/dnadesign / TestComplement

Function TestComplement

lib/transform/transform_test.go:30–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func TestComplement(t *testing.T) {
31 seed := rand.New(rand.NewSource(1)).Int63()
32 sequence, err := random.DNASequence(20, seed)
33 if err != nil {
34 t.Errorf("failed to generate random DNA sequence")
35 }
36 for _, testSequence := range []string{sequence} { // loop is unneeded but makes it easier to add more test cases in the future.
37 complementSequence := Complement(testSequence)
38 for index, complement := range complementSequence {
39 expectedBase := ComplementBase(rune(testSequence[index]))
40 if complement != expectedBase {
41 t.Errorf("bad %q complement: got %q, expect %q", testSequence[index], complement, expectedBase)
42 }
43 }
44 }
45}
46
47func TestReverseComplement(t *testing.T) {
48 seed := rand.New(rand.NewSource(1)).Int63()

Callers

nothing calls this directly

Calls 2

ComplementFunction · 0.85
ComplementBaseFunction · 0.85

Tested by

no test coverage detected