Skip to content

Commit cd8d0af

Browse files
committed
Add tests
1 parent 82d2577 commit cd8d0af

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/runtests.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,23 @@ end
626626
@test <(x, x1)
627627
end
628628

629+
@testset "New Meta Methods"
630+
ls = [LineString([Point(i, (i+1)^2/6), Point(i*0.86,i+5), Point(i/3, i/7)]) for i in 1:10]
631+
mls = MultiLineString([LineString([Point(i+1, (i)^2/6), Point(i*0.75,i+8), Point(i/2.5, i/6.79)]) for i in 5:10])
632+
poly = Polygon(Point{2, Int}[(40, 40), (20, 45), (45, 30), (40, 40)])
633+
geom = [ls..., mls, poly]
634+
prop = [(country_states = "India$(i)", rainfall = i*10) for i in 1:12]
635+
636+
feat = [GeometryBasics.Feature(i, j) for (i,j) = zip(geom, prop)]
637+
sa = GeometryBasics.structarray(feat)
638+
639+
@test nameof(eltype(feat)) == :Feature
640+
@test eltype(sa) === GeometryBasics.Feature{Any,(:country_states, :rainfall),Tuple{String,Int64}}
641+
@test propertynames(sa) === (:data, :country_states, :rainfall)
642+
@test getproperty(sa, :country_states) isa Array{String}
643+
@test getproperty(sa, :data) == geom
644+
end
645+
629646
@testset "Tests from GeometryTypes" begin
630647
include("geometrytypes.jl")
631648
end

0 commit comments

Comments
 (0)