diff --git a/lib/src/turf_equality_base.dart b/lib/src/turf_equality_base.dart index 114a00c..b614bbe 100644 --- a/lib/src/turf_equality_base.dart +++ b/lib/src/turf_equality_base.dart @@ -133,7 +133,7 @@ class Equality { line1.coordinates.first, newLine.coordinates.first)) { return false; } else { - _compareLine(line1, newLine); + return _compareLine(line1, newLine); } } } else { diff --git a/test/context/helper.dart b/test/context/helper.dart new file mode 100644 index 0000000..f786283 --- /dev/null +++ b/test/context/helper.dart @@ -0,0 +1,25 @@ +import 'package:turf/helpers.dart'; + +LineString lineString(List> coordinates) { + return LineString(coordinates: coordinates.toPositions()); +} + +Point point(List coordinates) { + return Point(coordinates: Position.of(coordinates)); +} + +Feature polygon(List>> coordinates) { + return Feature( + geometry: Polygon(coordinates: coordinates.toPositions()), + ); +} + +extension PointsExtension on List> { + List toPositions() => + map((position) => Position.of(position)).toList(growable: false); +} + +extension PolygonPointsExtensions on List>> { + List> toPositions() => + map((element) => element.toPositions()).toList(growable: false); +}