Sha256: d899c941f25b27117ce686b626f3ee8ee5f0ebb7d40c17f9cbdda2767db2c0a3

Contents?: true

Size: 278 Bytes

Versions: 289

Compression:

Stored size: 278 Bytes

Contents

using Base.Test

include("pascals-triangle.jl")

rows = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]]

@testset "$i row(s)" for i in 1:4
    @test triangle(i) == rows[1:i]
end

@testset "special cases" begin
    @test_throws DomainError triangle(-1)
    @test isempty(triangle(0))
end

Version data entries

289 entries across 289 versions & 1 rubygems

Version Path
trackler-2.2.1.159 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.158 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.157 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.156 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.155 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.154 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.153 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.152 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.151 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.150 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.149 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.148 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.147 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.146 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.145 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.144 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.143 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.142 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.141 tracks/julia/exercises/pascals-triangle/runtests.jl
trackler-2.2.1.140 tracks/julia/exercises/pascals-triangle/runtests.jl