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.139 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.138 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.137 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.136 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.135 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.134 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.133 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.132 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.131 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.130 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.129 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.128 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.127 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.126 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.125 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.124 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.123 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.122 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.121 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.120 tracks/julia/exercises/secret-handshake/runtests.jl