Sha256: 2cb633cb800c084086c0a9ae782ed5c009272c6e9b1fa6240a6c21242dc608d1

Contents?: true

Size: 645 Bytes

Versions: 306

Compression:

Stored size: 645 Bytes

Contents

using Base.Test

include("luhn.jl")

@testset "invalid" begin
    @testset "single digit strings can not be valid" begin
        @test !luhn("1")
    end

    @testset "A single zero is invalid" begin
        @test !luhn("0")
    end

    @testset "invalid Canadian SIN" begin
        @test !luhn("046 454 287")
    end

    @testset "invalid credit card" begin
        @test !luhn("8273 1232 7352 0569")
    end

    @testset "valid strings with a non-digit added become invalid" begin
        @test !luhn("046a 454 286")
    end
end

@testset "valid" begin
    @testset "valid Canadian SIN" begin
        @test luhn("046 454 286")
    end
end

Version data entries

306 entries across 306 versions & 1 rubygems

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