2016-05-13 02:26:52 +00:00
|
|
|
module Main exposing (..)
|
2016-03-11 23:44:46 +00:00
|
|
|
|
|
|
|
import ElmTest exposing (..)
|
|
|
|
import RNATranscription exposing (toRNA)
|
|
|
|
|
|
|
|
|
|
|
|
tests : Test
|
|
|
|
tests =
|
|
|
|
suite
|
|
|
|
"RNATranscription"
|
|
|
|
[ test
|
|
|
|
"complement of cytosine is guanine"
|
|
|
|
(assertEqual (Ok "G") (toRNA "C"))
|
|
|
|
, test
|
|
|
|
"complement of guanine is cytosine"
|
|
|
|
(assertEqual (Ok "C") (toRNA "G"))
|
|
|
|
, test
|
|
|
|
"complement of thymine is adenine"
|
|
|
|
(assertEqual (Ok "A") (toRNA "T"))
|
|
|
|
, test
|
|
|
|
"complement of adenine is uracil"
|
|
|
|
(assertEqual (Ok "U") (toRNA "A"))
|
|
|
|
, test
|
|
|
|
"complement"
|
|
|
|
(assertEqual (Ok "UGCACCAGAAUU") (toRNA "ACGTGGTCTTAA"))
|
|
|
|
, test
|
|
|
|
"correctly handles completely invalid input"
|
|
|
|
(assertEqual (Err 'X') (toRNA "XXX"))
|
|
|
|
, test
|
|
|
|
"correctly handles partially invalid input"
|
|
|
|
(assertEqual (Err 'U') (toRNA "UGAAXXXGACAUG"))
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2016-05-13 02:26:52 +00:00
|
|
|
main : Program Never
|
|
|
|
main =
|
|
|
|
runSuite tests
|