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.0.8.55 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.54 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.53 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.52 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.51 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.50 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.49 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.48 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.47 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.46 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.45 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.44 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.43 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.42 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.41 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.40 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.39 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.38 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.37 tracks/purescript/exercises/atbash-cipher/test/Main.purs
trackler-2.0.8.36 tracks/purescript/exercises/atbash-cipher/test/Main.purs