Skip to content

Commit 839f463

Browse files
committed
add test macro to testgeometry
Not strictly needed since they trigger AssertionErrors if not ok, but good to count towards the tests since they return true if they don't fail.
1 parent 0a01573 commit 839f463

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/geointerface.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
@testset "Basic types" begin
22
point = Point(2, 3)
3-
testgeometry(point)
3+
@test testgeometry(point)
44
@test ncoord(point) == 2
55
@test getcoord(point, 2) == 3
66
@test GeoInterface.coordinates(point) == [2, 3]
77

88
mp = MultiPoint([point, point])
9-
testgeometry(mp)
9+
@test testgeometry(mp)
1010
@test ngeom(mp) == 2
1111
@test getgeom(mp, 2) == point
1212
@test GeoInterface.coordinates(mp) == [[2, 3], [2, 3]]
1313

1414
linestring = LineString(Point{2,Int}[(10, 10), (20, 20), (10, 40)])
15-
testgeometry(linestring)
15+
@test testgeometry(linestring)
1616
@test ngeom(linestring) == 3
1717
@test getgeom(linestring, 1) == Point(10, 10)
1818
@test getgeom(linestring, 2) == Point(20, 20)
1919
@test getgeom(linestring, 3) == Point(10, 40)
2020
@test GeoInterface.coordinates(linestring) == [[10, 10], [20, 20], [10, 40]]
2121

2222
multilinestring = MultiLineString([linestring, linestring])
23-
testgeometry(multilinestring)
23+
@test testgeometry(multilinestring)
2424
@test GeoInterface.coordinates(multilinestring) ==
2525
[[[10, 10], [20, 20], [10, 40]], [[10, 10], [20, 20], [10, 40]]]
2626

2727
poly = Polygon(rand(Point{2,Float32}, 5), [rand(Point{2,Float32}, 5)])
28-
testgeometry(poly)
28+
@test testgeometry(poly)
2929
@test length(GeoInterface.coordinates(poly)) == 2
3030
@test length(GeoInterface.coordinates(poly)[1]) == 5
3131

3232
triangle = Triangle(point, point, point)
33-
testgeometry(triangle)
33+
@test testgeometry(triangle)
3434
@test length(GeoInterface.coordinates(triangle)) == 1
3535
@test length(GeoInterface.coordinates(triangle)[1]) == 3
3636

3737
polys = MultiPolygon([poly, poly])
38-
testgeometry(polys)
38+
@test testgeometry(polys)
3939
@test length(GeoInterface.coordinates(polys)) == 2
4040
@test length(GeoInterface.coordinates(polys)[1]) == 2
4141
@test length(GeoInterface.coordinates(polys)[1][1]) == 5
4242
end
4343

4444
@testset "Mesh" begin
4545
mesh = triangle_mesh(Sphere(Point3f(0), 1))
46-
testgeometry(mesh)
46+
@test testgeometry(mesh)
4747
end

0 commit comments

Comments
 (0)