Skip to content

Commit

Permalink
Make go/rna-transcription match new README. See exercism#1310.
Browse files Browse the repository at this point in the history
  • Loading branch information
kytrinyx authored and mscoutermarsh committed Jan 25, 2014
1 parent a3fcc68 commit e4e9a1d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
8 changes: 6 additions & 2 deletions assignments/go/rna-transcription/example.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package rnatranscription
package strand

import "strings"

func ToRna(dna string) string {
return strings.Replace(dna, "T", "U", -1)
dna = strings.Replace(dna, "A", "u", -1)
dna = strings.Replace(dna, "T", "a", -1)
dna = strings.Replace(dna, "C", "g", -1)
dna = strings.Replace(dna, "G", "c", -1)
return strings.ToUpper(dna)
}
12 changes: 6 additions & 6 deletions assignments/go/rna-transcription/rna_transcription_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package rnatranscription
package strand

import (
"testing"
Expand All @@ -10,11 +10,11 @@ type rnaTest struct {
}

var rnaTests = []rnaTest{
{"C", "C"},
{"G", "G"},
{"A", "A"},
{"T", "U"},
{"ACGTGGTCTTAA", "ACGUGGUCUUAA"},
{"C", "G"},
{"G", "C"},
{"A", "U"},
{"T", "A"},
{"ACGTGGTCTTAA", "UGCACCAGAAUU"},
}

func TestRnaTranscription(t *testing.T) {
Expand Down

0 comments on commit e4e9a1d

Please sign in to comment.