Sha256: f420bb45c85122d03a59fb3d9df92dd83681a7476d8cac4a303d57443c8352db

Contents?: true

Size: 1.35 KB

Versions: 129

Compression:

Stored size: 1.35 KB

Contents

module Test.Main where

import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.AVar (AVAR)
import Control.Monad.Eff.Console (CONSOLE)
import Data.Maybe (Maybe(..))
import Test.Unit (TestSuite, suite, test)
import Test.Unit.Assert as Assert
import Test.Unit.Console (TESTOUTPUT)
import Test.Unit.Main (runTest)
import RNATranscription (toRNA)

main :: forall eff
  . Eff ( avar :: AVAR
        , console :: CONSOLE
        , testOutput :: TESTOUTPUT
        | eff
        )
        Unit
main = runTest suites

suites :: forall e. TestSuite e
suites =
  suite "RNATranscription.toRNA" do
    test "RNA complement of cytosine is guanine" $
      Assert.equal (Just "G") (toRNA "C")

    test "RNA complement of guanine is cytosine" $
      Assert.equal (Just "C") (toRNA "G")

    test "RNA complement of thymine is adenine" $
      Assert.equal (Just "A") (toRNA "T")

    test "RNA complement of adenine is uracil" $
      Assert.equal (Just "U") (toRNA "A")

    test "RNA complement" $
      Assert.equal (Just "UGCACCAGAAUU") (toRNA "ACGTGGTCTTAA")

    test "correctly handles invalid input (RNA instead of DNA)" $
      Assert.equal Nothing (toRNA "U")

    test "correctly handles completely invalid DNA input" $
      Assert.equal Nothing (toRNA "XXX")

    test "correctly handles partially invalid DNA input" $
      Assert.equal Nothing (toRNA "ACGTXXXCTTAA")

Version data entries

129 entries across 129 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.179 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.178 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.177 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.176 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.175 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.174 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.173 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.172 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.171 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.170 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.169 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.167 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.166 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.165 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.164 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.163 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.162 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.161 tracks/purescript/exercises/rna-transcription/test/Main.purs
trackler-2.2.1.160 tracks/purescript/exercises/rna-transcription/test/Main.purs