Sha256: 2d65d9cd418a07f0a3ad8188f70c88b323cd6ba698788eb793486a25ec1319f0

Contents?: true

Size: 1.21 KB

Versions: 312

Compression:

Stored size: 1.21 KB

Contents

using Base.Test

include("secret-handshake.jl")

@testset "wink for 1" begin
    @test secret_handshake(1) == ["wink"]
end

@testset "double blink for 10" begin
    @test secret_handshake(2) == ["double blink"]
end

@testset "close your eyes for 100" begin
    @test secret_handshake(4) == ["close your eyes"]
end

@testset "jump for 1000" begin
    @test secret_handshake(8) == ["jump"]
end

@testset "combine two actions" begin
    @test secret_handshake(3) == ["wink", "double blink"]
end

@testset "reverse two actions" begin
    @test secret_handshake(19) == ["double blink", "wink"]
end

@testset "reversing one action gives the same action" begin
    @test secret_handshake(24) == ["jump"]
end

@testset "reversing no actions still gives no actions" begin
    @test secret_handshake(16) == []
end

@testset "all possible actions" begin
    @test secret_handshake(15) == ["wink", "double blink", "close your eyes", "jump"]
end

@testset "reverse all possible actions" begin
    @test secret_handshake(31) == ["jump", "close your eyes", "double blink", "wink"]
end

@testset "do nothing for zero" begin
    @test secret_handshake(0) == []
end

@testset "do nothing if lower 5 bits not set" begin
    @test secret_handshake(32) == []
end

Version data entries

312 entries across 312 versions & 1 rubygems

Version Path
trackler-2.2.1.98 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.97 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.96 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.95 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.94 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.93 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.92 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.91 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.90 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.89 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.88 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.87 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.86 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.85 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.84 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.83 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.82 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.81 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.80 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.79 tracks/julia/exercises/secret-handshake/runtests.jl