Sha256: 3c53f2aacc1bf24630352fb19d886c9d77ffb19f1626aa549c308d2eaf9b68aa

Contents?: true

Size: 1.79 KB

Versions: 127

Compression:

Stored size: 1.79 KB

Contents

module Test.Main where

import Prelude
import Control.Monad.Eff (Eff)
import Data.Maybe (Maybe(..))
import Test.Unit.Assert as Assert
import Test.Unit (suite, test)
import Test.Unit.Main (runTest)
import AtbashCipher (decode, encode)

main :: Eff _ Unit
main = runTest do

  suite "AtbashCipher.encode" do

    test "encode yes" $
      Assert.equal (Just "bvh")
                   (encode "yes")

    test "encode no" $
      Assert.equal (Just "ml")
                   (encode "no")

    test "encode OMG" $
      Assert.equal (Just "lnt")
                   (encode "OMG")

    test "encode spaces" $
      Assert.equal (Just "lnt")
                   (encode "O M G")

    test "encode mindblowingly" $
      Assert.equal (Just "nrmwy oldrm tob")
                   (encode "mindblowingly")

    test "encode numbers" $
      Assert.equal (Just "gvhgr mt123 gvhgr mt")
                   (encode "Testing,1 2 3, testing.")

    test "encode deep thought" $
      Assert.equal (Just "gifgs rhurx grlm")
                   (encode "Truth is fiction.")

    test "encode all the letters" $
      Assert.equal (Just "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt")
                   (encode "The quick brown fox jumps over the lazy dog.")

  suite "AtbashCipher.decode" do

    test "decode exercism" $
      Assert.equal (Just "exercism")
                   (decode "vcvix rhn")

    test "decode a sentence" $
      Assert.equal (Just "anobstacleisoftenasteppingstone")
                   (decode "zmlyh gzxov rhlug vmzhg vkkrm thglm v")

    test "decode numbers" $
      Assert.equal (Just "testing123testing")
                   (decode "gvhgr mt123 gvhgr mt")

    test "decode all the letters" $
      Assert.equal (Just "thequickbrownfoxjumpsoverthelazydog")
                   (decode "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt")

Version data entries

127 entries across 127 versions & 1 rubygems

Version Path
trackler-2.2.1.37 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.36 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.35 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.34 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.33 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.32 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.31 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.30 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.29 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.28 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.27 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.26 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.25 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.24 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.23 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.22 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.21 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.20 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.19 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.2.1.18 tracks/purescript/exercises/atbash-cipher/test/Main.purs