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.119 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.118 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.117 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.116 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.115 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.114 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.113 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.111 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.110 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.109 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.108 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.107 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.106 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.105 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.104 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.103 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.102 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.101 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.100 tracks/julia/exercises/secret-handshake/runtests.jl
trackler-2.2.1.99 tracks/julia/exercises/secret-handshake/runtests.jl