2016-03-17 01:38:35 +00:00
|
|
|
module Main (..) where
|
2016-03-17 01:36:38 +00:00
|
|
|
|
2016-03-17 01:38:35 +00:00
|
|
|
import Task
|
|
|
|
import Console
|
|
|
|
import ElmTest exposing (..)
|
|
|
|
import NucleotideCount exposing (nucleotideCounts)
|
2016-03-17 01:36:38 +00:00
|
|
|
|
2016-03-17 01:38:51 +00:00
|
|
|
|
2016-03-17 01:36:38 +00:00
|
|
|
tests : Test
|
2016-03-17 01:38:51 +00:00
|
|
|
tests =
|
|
|
|
suite
|
|
|
|
"NucleotideCount"
|
|
|
|
[ test
|
|
|
|
"empty dna strand has no nucleotides"
|
|
|
|
(assertEqual
|
|
|
|
[ ( 'A', 0 ), ( 'T', 0 ), ( 'C', 0 ), ( 'G', 0 ) ]
|
|
|
|
(nucleotideCounts "")
|
|
|
|
)
|
|
|
|
, test
|
|
|
|
"repetitive-sequence-has-only-guanosine"
|
|
|
|
(assertEqual
|
|
|
|
[ ( 'A', 0 ), ( 'T', 0 ), ( 'C', 0 ), ( 'G', 8 ) ]
|
|
|
|
(nucleotideCounts "GGGGGGGG")
|
|
|
|
)
|
|
|
|
, test
|
|
|
|
"counts all nucleotides"
|
|
|
|
(assertEqual
|
|
|
|
[ ( 'A', 20 ), ( 'T', 21 ), ( 'C', 12 ), ( 'G', 17 ) ]
|
|
|
|
(nucleotideCounts "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC")
|
|
|
|
)
|
|
|
|
]
|
|
|
|
|
2016-03-17 01:36:38 +00:00
|
|
|
|
2016-03-17 01:38:35 +00:00
|
|
|
port runner : Signal (Task.Task x ())
|
|
|
|
port runner =
|
|
|
|
Console.run (consoleRunner tests)
|