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.180 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.179 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.178 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.177 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.176 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.175 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.174 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.173 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.172 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.171 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.170 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.169 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.167 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.166 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.165 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.164 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.163 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.162 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.161 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.160 tracks/julia/exercises/secret-handshake/runtests.jl