Skip to content

Commit

Permalink
Add parent testset
Browse files Browse the repository at this point in the history
  • Loading branch information
helgee committed Feb 14, 2018
1 parent cb204d7 commit abba1ca
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 65 deletions.
4 changes: 2 additions & 2 deletions src/SPICE.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#= __precompile__() =#

module SPICE

export SpiceException

#= __precompile__() =#

deps = abspath(joinpath(splitdir(@__FILE__)[1], "..", "deps", "deps.jl"))
if isfile(deps)
include(deps)
Expand Down
128 changes: 65 additions & 63 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,76 +24,78 @@ end

path(kernel) = kernels[kernel][:file]

@testset "Cells" begin
cell = SpiceIntCell(3)
appnd(1, cell)
appnd(2, cell)
appnd(3, cell)
@test cell[1:end] == [1, 2, 3]
@testset "SPICE" begin
@testset "Cells" begin
cell = SpiceIntCell(3)
appnd(1, cell)
appnd(2, cell)
appnd(3, cell)
@test cell[1:end] == [1, 2, 3]

cell = SpiceIntCell(3)
push!(cell, 1, 2, 3)
@test cell[1:end] == [1, 2, 3]
cell = SpiceIntCell(3)
push!(cell, 1, 2, 3)
@test cell[1:end] == [1, 2, 3]

cell = SpiceIntCell(3)
append!(cell, [1, 2, 3])
@test cell[1:end] == [1, 2, 3]
cell = SpiceIntCell(3)
append!(cell, [1, 2, 3])
@test cell[1:end] == [1, 2, 3]

cell = SpiceDoubleCell(3)
appnd(1, cell)
appnd(2, cell)
appnd(3, cell)
@test cell[1:end] == [1.0, 2.0, 3.0]
cell = SpiceDoubleCell(3)
appnd(1, cell)
appnd(2, cell)
appnd(3, cell)
@test cell[1:end] == [1.0, 2.0, 3.0]

cell = SpiceDoubleCell(3)
push!(cell, 1, 2, 3)
@test cell[1:end] == [1.0, 2.0, 3.0]
cell = SpiceDoubleCell(3)
push!(cell, 1, 2, 3)
@test cell[1:end] == [1.0, 2.0, 3.0]

cell = SpiceDoubleCell(3)
append!(cell, [1, 2, 3])
@test cell[1:end] == [1.0, 2.0, 3.0]
cell = SpiceDoubleCell(3)
append!(cell, [1, 2, 3])
@test cell[1:end] == [1.0, 2.0, 3.0]

cell = SpiceCharCell(3, 6)
appnd("foobar1", cell)
appnd("foobar2", cell)
appnd("foobar3", cell)
@test cell[1:end] == fill("foobar", 3)
cell = SpiceCharCell(3, 6)
appnd("foobar1", cell)
appnd("foobar2", cell)
appnd("foobar3", cell)
@test cell[1:end] == fill("foobar", 3)

cell = SpiceCharCell(3, 6)
push!(cell, "foobar1", "foobar2", "foobar3")
@test cell[1:end] == fill("foobar", 3)
cell = SpiceCharCell(3, 6)
push!(cell, "foobar1", "foobar2", "foobar3")
@test cell[1:end] == fill("foobar", 3)

cell = SpiceCharCell(3, 6)
append!(cell, ["foobar1", "foobar2", "foobar3"])
@test cell[1:end] == fill("foobar", 3)
@test card(cell) == 3
cell = SpiceCharCell(3, 6)
append!(cell, ["foobar1", "foobar2", "foobar3"])
@test cell[1:end] == fill("foobar", 3)
@test card(cell) == 3

cell = SpiceIntCell(1)
@test_throws ErrorException cell[1]
@test_throws ErrorException cell[2]
end
cell = SpiceIntCell(1)
@test_throws ErrorException cell[1]
@test_throws ErrorException cell[2]
end

include("a.jl")
include("b.jl")
include("c.jl")
include("d.jl")
include("e.jl")
include("f.jl")
include("g.jl")
include("h.jl")
include("i.jl")
include("j.jl")
include("k.jl")
include("l.jl")
include("m.jl")
include("n.jl")
include("o.jl")
include("p.jl")
include("q.jl")
include("r.jl")
include("s.jl")
include("t.jl")
include("u.jl")
include("v.jl")
include("w.jl")
include("x.jl")
include("a.jl")
include("b.jl")
include("c.jl")
include("d.jl")
include("e.jl")
include("f.jl")
include("g.jl")
include("h.jl")
include("i.jl")
include("j.jl")
include("k.jl")
include("l.jl")
include("m.jl")
include("n.jl")
include("o.jl")
include("p.jl")
include("q.jl")
include("r.jl")
include("s.jl")
include("t.jl")
include("u.jl")
include("v.jl")
include("w.jl")
include("x.jl")
end

0 comments on commit abba1ca

Please sign in to comment.