Sha256: 88449cf5f0cdd262e9f947d87fa432df48d762d440aabf31f740491b600d9863

Contents?: true

Size: 939 Bytes

Versions: 127

Compression:

Stored size: 939 Bytes

Contents

using Base.Test

include("run-length-encoding.jl")


# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
# Encode and decode the strings under the given specifications.

@testset "encode strings" begin
    @test encode("") == ""
    @test encode("XYZ") == "XYZ"
    @test encode("AABBBCCCC") == "2A3B4C"
    @test encode("WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB") == "12WB12W3B24WB"
    @test encode("aabbbcccc") == "2a3b4c"
    @test encode("  hsqq qww  ") == "2 hs2q q2w2 "
end

@testset "decode strings" begin
    @test decode("") == ""
    @test decode("XYZ") == "XYZ"
    @test decode("2A3B4C") == "AABBBCCCC"
    @test decode("12WB12W3B24WB") == "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"
    @test decode("2a3b4c") == "aabbbcccc"
    @test decode("2 hs2q q2w2 ") == "  hsqq qww  "
end

@testset "encode then decode" begin
    @test decode(encode("zzz ZZ  zZ")) == "zzz ZZ  zZ"
end

Version data entries

127 entries across 127 versions & 1 rubygems

Version Path
trackler-2.2.1.78 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.77 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.76 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.75 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.74 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.73 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.72 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.71 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.70 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.69 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.68 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.67 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.66 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.65 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.64 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.63 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.62 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.61 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.60 tracks/julia/exercises/run-length-encoding/runtests.jl
trackler-2.2.1.59 tracks/julia/exercises/run-length-encoding/runtests.jl