Sha256: c1a5ed9135f9b31f541c106189557b051a84c573ae1f1d237478a47fe9267ce7
Contents?: true
Size: 1.91 KB
Versions: 96
Compression:
Stored size: 1.91 KB
Contents
{-# LANGUAGE RecordWildCards #-} import Data.Foldable (for_) import Test.Hspec (Spec, describe, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import DNA (toRNA) main :: IO () main = hspecWith defaultConfig {configFastFail = True} specs specs :: Spec specs = describe "toRNA" $ for_ cases test where test Case{..} = it description $ toRNA dna `shouldBe` expected data Case = Case { description :: String , dna :: String , expected :: Maybe String } cases :: [Case] cases = [ Case { description = "rna complement of cytosine is guanine" , dna = "C" , expected = Just "G" } , Case { description = "rna complement of guanine is cytosine" , dna = "G" , expected = Just "C" } , Case { description = "rna complement of thymine is adenine" , dna = "T" , expected = Just "A" } , Case { description = "rna complement of adenine is uracil" , dna = "A" , expected = Just "U" } , Case { description = "rna complement" , dna = "ACGTGGTCTTAA" , expected = Just "UGCACCAGAAUU" } , Case { description = "dna correctly handles invalid input" , dna = "U" , expected = Nothing } , Case { description = "dna correctly handles completely invalid input" , dna = "XXX" , expected = Nothing } , Case { description = "dna correctly handles partially invalid input" , dna = "ACGTXXXCTTAA" , expected = Nothing } ]
Version data entries
96 entries across 96 versions & 1 rubygems