Skip to content

Commit 1c24e83

Browse files
committed
make it easier to tell where errors are happening
1 parent 52d42e9 commit 1c24e83

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/methods/clipping/polygon_clipping.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,16 @@ function compare_GO_LG_clipping(GO_f, LG_f, p1, p2)
200200
else
201201
GO_result_geom = GI.MultiPolygon(GO_result_list)
202202
end
203-
diff_1_area = LG.area(LG.difference(GO_result_geom, LG_result_geom))
204-
diff_2_area = LG.area(LG.difference(LG_result_geom, GO_result_geom))
205-
@test diff_1_area ϵ && diff_2_area ϵ
203+
204+
diff_1_poly = @test_nowarn LG.difference(GO_result_geom, LG_result_geom)
205+
diff_2_poly = @test_nowarn LG.difference(LG_result_geom, GO_result_geom)
206+
if GI.isempty(diff_1_poly) || GI.isempty(diff_2_poly)
207+
@test true # if both differences are empty, then the areas are the same by default.
208+
else
209+
diff_1_area = LG.area(diff_1_poly)
210+
diff_2_area = LG.area(diff_2_poly)
211+
@test diff_1_area ϵ && diff_2_area ϵ
212+
end
206213
end # testset
207214
end # loop
208215
end

0 commit comments

Comments
 (0)