Skip to content

Commit

Permalink
[issue-195] Fixed type as per review.
Browse files Browse the repository at this point in the history
* Panic was spelled wrong in the one of the error messages for the
  test case.
* Additionally fixed a few `go vet` issues.
  • Loading branch information
gdey committed Dec 6, 2017
1 parent 0ca29da commit a9ef191
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions mvt/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ func (c *cursor) ScalePoint(p tegola.Point) (nx, ny int64) {
}

func (c *cursor) MinMax() (min, max maths.Pt) {
return maths.Pt{0 - tilebuffer, 0 - tilebuffer},
return maths.Pt{X: 0 - tilebuffer, Y: 0 - tilebuffer},
maths.Pt{
float64(c.extent + tilebuffer),
float64(c.extent + tilebuffer),
X: float64(c.extent + tilebuffer),
Y: float64(c.extent + tilebuffer),
}
}

Expand Down
2 changes: 1 addition & 1 deletion mvt/feature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestEncodeGeometry(t *testing.T) {
}
*/
testcases := []struct {
desc string `"test":"desc"`
desc string `tbltest:"desc"`
geo basic.Geometry
typ vectorTile.Tile_GeomType
bbox tegola.BoundingBox
Expand Down
6 changes: 3 additions & 3 deletions mvt/layer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ func TestLayerAddFeatures(t *testing.T) {
fn := func(idx int, tcase tc) {
defer func() {
if r := recover(); r != nil {
t.Errorf("Did not expect AddFeatures to painc: Recovered: %v", r)
t.Errorf("[%v] did not expect AddFeatures to panic: recovered: %v", idx, r)
}
}()
// First create a blank layer to add the features to.
l := new(Layer)
skipped := l.AddFeatures(tcase.features...)
if tcase.skipped != skipped {
t.Errorf("[%v] skipped value; expected: %v got: %v", tcase.skipped, skipped)
t.Errorf("[%v] skipped value; expected: %v got: %v", idx, tcase.skipped, skipped)
}
gotFeatures := l.Features()
expectedFeatures := tcase.expected
if expectedFeatures == nil {
expectedFeatures = tcase.features
}
if len(gotFeatures) != len(expectedFeatures) {
t.Errorf("[%v] number of features incorrect. expected: %v got: %v", len(expectedFeatures), len(gotFeatures))
t.Errorf("[%v] number of features incorrect. expected: %v got: %v", idx, len(expectedFeatures), len(gotFeatures))
}
for i := range expectedFeatures {
if !reflect.DeepEqual(expectedFeatures[i], gotFeatures[i]) {
Expand Down

0 comments on commit a9ef191

Please sign in to comment.