@@ -285,18 +285,24 @@ end
285285 @test collect (GeometryBasics. consecutive_pairs (ps)) == collect (zip (ps[1 : end - 1 ], ps[2 : end ]))
286286
287287 ps = Point2f[(0 ,0 ), (1 ,0 ), (0 ,1 ), (1 ,2 ), (0 ,2 ), (1 ,1 ), (0 ,0 )]
288- idxs, ips = self_intersections (ps)
288+ idxs, ips = _self_intersections (ps)
289289 @test idxs == [(2 , 6 ), (3 , 5 )]
290290 @test ips == [Point2f (0.5 ), Point2f (0.5 , 1.5 )]
291+ idxs2, ips2 = self_intersections (ps)
292+ @test ips2 == ips
293+ @test idxs2 == [2 , 6 , 3 , 5 ]
291294
292295 ps = [Point2f (cos (x), sin (x)) for x in 0 : 4pi / 5 : 4pi + 0.1 ]
293- idxs, ips = self_intersections (ps)
296+ idxs, ips = _self_intersections (ps)
294297 @test idxs == [(1 , 3 ), (1 , 4 ), (2 , 4 ), (2 , 5 ), (3 , 5 )]
295298 @test all (ips .≈ Point2f[(0.30901694 , 0.2245140 ), (- 0.118034005 , 0.36327127 ), (- 0.38196602 , 0 ), (- 0.118033946 , - 0.3632713 ), (0.309017 , - 0.22451389 )])
299+ idxs2, ips2 = self_intersections (ps)
300+ @test ips2 == ips
301+ @test idxs2 == [1 , 3 , 1 , 4 , 2 , 4 , 2 , 5 , 3 , 5 ]
296302
297303 @test_throws ErrorException split_intersections (ps)
298304 ps = Point2f[(0 ,0 ), (1 ,0 ), (0 ,1 ), (1 ,1 ), (0 , 0 )]
299- idxs, ips = self_intersections (ps)
305+ idxs, ips = _self_intersections (ps)
300306 sps = split_intersections (ps)
301307 @test sps[1 ] == [ps[3 ], ps[4 ], ips[1 ]]
302308 @test sps[2 ] == [ps[5 ], ps[1 ], ps[2 ], ips[1 ]]
0 commit comments