Sha256: 67e08e09e03e0568f930f909349f97fda0a6bec5491d315b8bbd10308da7e487

Contents?: true

Size: 1.04 KB

Versions: 311

Compression:

Stored size: 1.04 KB

Contents

using Base.Test

include("trinary.jl")

@testset "trinary 1 is decimal 1" begin
    @test trinary_to_decimal("1") == 1
end

@testset "trinary 2 is decimal 2" begin
    @test trinary_to_decimal("2") == 2
end

@testset "trinary 10 is decimal 3" begin
    @test trinary_to_decimal("10") == 3
end

@testset "trinary 11 is decimal 4" begin
    @test trinary_to_decimal("11") == 4
end

@testset "trinary 100 is decimal 9" begin
    @test trinary_to_decimal("100") == 9
end

@testset "trinary 112 is decimal 14" begin
    @test trinary_to_decimal("112") == 14
end

@testset "trinary 222 is decimal 26" begin
    @test trinary_to_decimal("222") == 26
end

@testset "trinary 1122000120 is decimal 32091" begin
    @test trinary_to_decimal("1122000120") == 32091
end

@testset "invalid trinary digits returns 0" begin
    @test trinary_to_decimal("1234") == 0
end

@testset "invalid word as input returns 0" begin
    @test trinary_to_decimal("carrot") == 0
end

@testset "invalid numbers with letters as input returns 0" begin
    @test trinary_to_decimal("0a1b2c") == 0
end

Version data entries

311 entries across 311 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.179 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.178 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.177 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.176 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.175 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.174 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.173 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.172 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.171 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.170 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.169 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.167 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.166 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.165 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.164 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.163 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.162 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.161 tracks/julia/exercises/trinary/runtests.jl
trackler-2.2.1.160 tracks/julia/exercises/trinary/runtests.jl