Sha256: e8a4f2eb61c7c363b89e82c369fd8f532e743c64c8da2b02e8f8f9827f1369e9

Contents?: true

Size: 1.5 KB

Versions: 141

Compression:

Stored size: 1.5 KB

Contents

port module Main exposing (..)

import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
import AtbashCipher exposing (encode, decode)


tests : Test
tests =
    describe "AtbashCipher"
        [ test "encode no" <|
            \() -> Expect.equal "ml" (encode "no")
        , test "encode yes" <|
            \() -> Expect.equal "bvh" (encode "yes")
        , test "encode OMG" <|
            \() -> Expect.equal "lnt" (encode "OMG")
        , test "encode O M G" <|
            \() -> Expect.equal "lnt" (encode "O M G")
        , test "encode long word" <|
            \() -> Expect.equal "nrmwy oldrm tob" (encode "mindblowingly")
        , test "encode numbers" <|
            \() -> Expect.equal "gvhgr mt123 gvhgr mt" (encode "Testing, 1 2 3, testing.")
        , test "encode sentence" <|
            \() -> Expect.equal "gifgs rhurx grlm" (encode "Truth is fiction.")
        , test "encode all things" <|
            \() ->
                Expect.equal "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
                    (encode "The quick brown fox jumps over the lazy dog.")
        , test "decode word" <|
            \() -> Expect.equal "exercism" (decode "vcvix rhn")
        , test "decode sentence" <|
            \() ->
                Expect.equal "anobstacleisoftenasteppingstone"
                    (decode "zmlyh gzxov rhlug vmzhg vkkrm thglm v")
        ]


main : TestProgram
main =
    run emit tests


port emit : ( String, Value ) -> Cmd msg

Version data entries

141 entries across 141 versions & 1 rubygems

Version Path
trackler-2.1.0.23 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.22 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.21 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.20 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.19 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.18 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.17 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.16 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.15 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.14 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.13 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.12 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.11 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.10 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.9 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.8 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.7 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.6 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.5 tracks/elm/exercises/atbash-cipher/Tests.elm
trackler-2.1.0.4 tracks/elm/exercises/atbash-cipher/Tests.elm