Skip to content

Commit

Permalink
Check input to MakeValid tests are invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstace committed Nov 21, 2021
1 parent 1fa5b98 commit 65c2837
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions geos/entrypoints_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ func expectNoErr(t *testing.T, err error) {
}
}

func expectErr(t *testing.T, err error) {
t.Helper()
if err == nil {
t.Fatal("unexpected error but got nil")
}
}

func expectGeomEq(t *testing.T, got, want geom.Geometry, opts ...geom.ExactEqualsOption) {
t.Helper()
if !geom.ExactEquals(got, want, opts...) {
Expand Down Expand Up @@ -779,6 +786,8 @@ func TestMakeValid(t *testing.T) {
},
} {
t.Run(strconv.Itoa(i), func(t *testing.T) {
_, err := geom.UnmarshalWKT(tt.input)
expectErr(t, err)
in := geomFromWKT(t, tt.input, geom.DisableAllValidations)
gotGeom, err := MakeValid(in)
if _, ok := err.(unsupportedGEOSVersionError); ok {
Expand Down

0 comments on commit 65c2837

Please sign in to comment.