mirror of
https://github.com/correl/elm.git
synced 2024-12-23 03:00:08 +00:00
36 lines
895 B
Elm
36 lines
895 B
Elm
module Main (..) where
|
|
|
|
import Task
|
|
import Console
|
|
import ElmTest exposing (..)
|
|
import NucleotideCount exposing (nucleotideCounts)
|
|
|
|
|
|
tests : Test
|
|
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")
|
|
)
|
|
]
|
|
|
|
|
|
port runner : Signal (Task.Task x ())
|
|
port runner =
|
|
Console.run (consoleRunner tests)
|