Skip to content

Commit

Permalink
Geo: fix GeoWKTShapeParserTests (#44448)
Browse files Browse the repository at this point in the history
Changes in #44187 introduced some optimization in the way shapes are
generated. These changes were not captured in GeoWKTShapeParserTests.

Relates #44187
  • Loading branch information
imotov authored Jul 17, 2019
1 parent 7247690 commit dc5c584
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.geo.geometry.Geometry;
import org.elasticsearch.geo.geometry.GeometryCollection;
import org.elasticsearch.geo.geometry.Line;
import org.elasticsearch.geo.geometry.MultiLine;
import org.elasticsearch.geo.geometry.MultiPoint;
Expand Down Expand Up @@ -131,6 +132,9 @@ public void testParseMultiPoint() throws IOException, ParseException {
if (numPoints == 0) {
expectedGeom = MultiPoint.EMPTY;
actual = new MultiPointBuilder();
} else if (numPoints == 1) {
expectedGeom = points.get(0);
actual = new MultiPointBuilder(coordinates);
} else {
expectedGeom = new MultiPoint(points);
actual = new MultiPointBuilder(coordinates);
Expand Down Expand Up @@ -195,7 +199,7 @@ public void testParseMultiLineString() throws IOException, ParseException {
}
Geometry expectedGeom;
if (lines.isEmpty()) {
expectedGeom = MultiLine.EMPTY;
expectedGeom = GeometryCollection.EMPTY;
} else if (lines.size() == 1) {
expectedGeom = new Line(lines.get(0).getLats(), lines.get(0).getLons());
} else {
Expand Down

0 comments on commit dc5c584

Please sign in to comment.