@@ -176,7 +176,7 @@ mod test {
176
176
/// Tests: Point in LineString
177
177
#[ test]
178
178
fn empty_linestring_test ( ) {
179
- let linestring = LineString :: new ( Vec :: new ( ) ) ;
179
+ let linestring = LineString :: empty ( ) ;
180
180
assert ! ( !linestring. contains( & Point :: new( 2. , 1. ) ) ) ;
181
181
}
182
182
#[ test]
@@ -196,8 +196,7 @@ mod test {
196
196
/// Tests: Point in Polygon
197
197
#[ test]
198
198
fn empty_polygon_test ( ) {
199
- let linestring = LineString :: new ( Vec :: new ( ) ) ;
200
- let poly = Polygon :: new ( linestring, Vec :: new ( ) ) ;
199
+ let poly = Polygon :: empty ( ) ;
201
200
assert ! ( !poly. contains( & Point :: new( 2. , 1. ) ) ) ;
202
201
}
203
202
#[ test]
@@ -275,7 +274,7 @@ mod test {
275
274
/// Tests: Point in MultiPolygon
276
275
#[ test]
277
276
fn empty_multipolygon_test ( ) {
278
- let multipoly = MultiPolygon :: new ( Vec :: new ( ) ) ;
277
+ let multipoly = MultiPolygon :: empty ( ) ;
279
278
assert ! ( !multipoly. contains( & Point :: new( 2. , 1. ) ) ) ;
280
279
}
281
280
#[ test]
@@ -605,7 +604,7 @@ mod test {
605
604
#[ test]
606
605
fn rect_contains_empty_polygon ( ) {
607
606
let rect = Rect :: new ( coord ! { x: 90. , y: 150. } , coord ! { x: 300. , y: 360. } ) ;
608
- let empty_poly = Polygon :: new ( line_string ! [ ] , vec ! [ ] ) ;
607
+ let empty_poly = Polygon :: empty ( ) ;
609
608
assert_eq ! (
610
609
rect. contains( & empty_poly) ,
611
610
rect. relate( & empty_poly) . is_contains( )
0 commit comments