Sha256: 5e5c2ac1fc9e22d25931e7ab0105eb25433b92a64b1ff05b428d25e2bb38cae8

Contents?: true

Size: 1.4 KB

Versions: 29

Compression:

Stored size: 1.4 KB

Contents

module Tests exposing (..)

import Test exposing (..)
import Expect
import RunLengthEncoding exposing (version, decode, encode)


tests : Test
tests =
    describe "RunLengthEncoding"
        [ test "the solution is for the correct version of the test" <|
            \() -> Expect.equal 2 version
        , test "encode simple" <|
            \() -> Expect.equal "2A3B4C" (encode "AABBBCCCC")
        , test "decode simple" <|
            \() -> Expect.equal "AABBBCCCC" (decode "2A3B4C")
        , test "encode with single values" <|
            \() ->
                Expect.equal "12WB12W3B24WB"
                    (encode "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB")
        , test "decode with single values" <|
            \() ->
                Expect.equal "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"
                    (decode "12WB12W3B24WB")
        , test "(decode (encode (...)) combination" <|
            \() ->
                Expect.equal "zzz ZZ  zZ"
                    (decode (encode "zzz ZZ  zZ"))
        , test "decode with a x10 value" <|
            \() ->
                Expect.equal "WWWWWWWWWW"
                    (decode "10W")
        , test "encode unicode" <|
            \() -> Expect.equal "⏰3⚽2⭐⏰" (encode "⏰⚽⚽⚽⭐⭐⏰")
        , test "decode unicode" <|
            \() -> Expect.equal "⏰⚽⚽⚽⭐⭐⏰" (decode "⏰3⚽2⭐⏰")
        ]

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
trackler-2.1.0.53 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.52 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.51 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.50 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.49 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.48 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.47 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.46 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.45 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.44 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.43 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.42 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.41 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.40 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.39 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.38 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.37 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.36 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.34 tracks/elm/exercises/run-length-encoding/tests/Tests.elm
trackler-2.1.0.33 tracks/elm/exercises/run-length-encoding/tests/Tests.elm