Skip to content

Commit

Permalink
Fixed indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
prashantkhoje authored May 26, 2022
1 parent 0cb3190 commit 4fafba7
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions pkg/geo/bbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package geo

import (
"fmt"
"math"
"math"
"strconv"
"testing"

Expand Down Expand Up @@ -185,22 +185,22 @@ func TestBoundingBoxFromGeomT(t *testing.T) {
t.Run(fmt.Sprintf("%s: %#v", tc.soType, tc.g), func(t *testing.T) {
bbox, err := boundingBoxFromGeomT(tc.g, tc.soType)
require.NoError(t, err)
// If bbox is within a small epsilon of expected, use the same values.
if bbox != nil && tc.expected != nil {
const epsilon = 0.000001
if math.Abs(bbox.LoX-tc.expected.LoX) < epsilon {
bbox.LoX = tc.expected.LoX
}
if math.Abs(bbox.HiX-tc.expected.HiX) < epsilon {
bbox.HiX = tc.expected.HiX
}
if math.Abs(bbox.LoY-tc.expected.LoY) < epsilon {
bbox.LoY = tc.expected.LoY
}
if math.Abs(bbox.HiY-tc.expected.HiY) < epsilon {
bbox.HiY = tc.expected.HiY
}
}
// If bbox is within a small epsilon of expected, use the same values.
if bbox != nil && tc.expected != nil {
const epsilon = 0.000001
if math.Abs(bbox.LoX-tc.expected.LoX) < epsilon {
bbox.LoX = tc.expected.LoX
}
if math.Abs(bbox.HiX-tc.expected.HiX) < epsilon {
bbox.HiX = tc.expected.HiX
}
if math.Abs(bbox.LoY-tc.expected.LoY) < epsilon {
bbox.LoY = tc.expected.LoY
}
if math.Abs(bbox.HiY-tc.expected.HiY) < epsilon {
bbox.HiY = tc.expected.HiY
}
}
require.Equal(t, tc.expected, bbox)
})
}
Expand Down

0 comments on commit 4fafba7

Please sign in to comment.