(t *testing.T)
| 23 | ) |
| 24 | |
| 25 | func TestClosestEdgeQueryNoEdges(t *testing.T) { |
| 26 | index := &ShapeIndex{} |
| 27 | query := NewClosestEdgeQuery(index, nil) |
| 28 | target := NewMinDistanceToPointTarget(PointFromCoords(1, 0, 0)) |
| 29 | edge := query.findEdge(target, query.opts) |
| 30 | |
| 31 | if edge.shapeID != -1 { |
| 32 | t.Errorf("shapeID for empty index should be -1, got %v", edge.shapeID) |
| 33 | } |
| 34 | if edge.edgeID != -1 { |
| 35 | t.Errorf("edgeID for empty index should be -1, got %v", edge.edgeID) |
| 36 | } |
| 37 | if got, want := edge.Distance(), s1.InfChordAngle(); got != want { |
| 38 | t.Errorf("edge.Distance = %+v, want %+v", got, want) |
| 39 | } |
| 40 | |
| 41 | if got, want := query.Distance(target), s1.InfChordAngle(); got != want { |
| 42 | t.Errorf("query.Distance(%v) = %+v, want %+v", target, got, want) |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | func TestClosestEdgeQueryBasicTest(t *testing.T) { |
| 47 | index := makeShapeIndex("1:1 | 1:2 | 1:3 # #") |
nothing calls this directly
no test coverage detected
searching dependent graphs…