(t *testing.T)
| 217 | } |
| 218 | |
| 219 | func TestLoopBasic(t *testing.T) { |
| 220 | shape := Shape(makeLoop("0:0, 0:1, 1:0")) |
| 221 | |
| 222 | if got, want := shape.NumEdges(), 3; got != want { |
| 223 | t.Errorf("shape.NumEdges() = %d, want %d", got, want) |
| 224 | } |
| 225 | if got, want := shape.NumChains(), 1; got != 1 { |
| 226 | t.Errorf("shape.NumChains() = %d, want %d", got, want) |
| 227 | } |
| 228 | if got, want := shape.Chain(0).Start, 0; got != 0 { |
| 229 | t.Errorf("shape.Chain(0).Start = %d, want %d", got, want) |
| 230 | } |
| 231 | if got, want := shape.Chain(0).Length, 3; got != want { |
| 232 | t.Errorf("shape.Chain(0).Length = %d, want %d", got, want) |
| 233 | } |
| 234 | |
| 235 | e := shape.Edge(2) |
| 236 | if want := PointFromLatLng(LatLngFromDegrees(1, 0)); !e.V0.ApproxEqual(want) { |
| 237 | t.Errorf("shape.Edge(2) end A = %v, want %v", e.V0, want) |
| 238 | } |
| 239 | if want := PointFromLatLng(LatLngFromDegrees(0, 0)); !e.V1.ApproxEqual(want) { |
| 240 | t.Errorf("shape.Edge(2) end B = %v, want %v", e.V1, want) |
| 241 | } |
| 242 | if got, want := shape.Dimension(), 2; got != want { |
| 243 | t.Errorf("shape.Dimension() = %v, want %v", got, want) |
| 244 | } |
| 245 | if shape.IsEmpty() { |
| 246 | t.Errorf("shape.IsEmpty() = true, want false") |
| 247 | } |
| 248 | if shape.IsFull() { |
| 249 | t.Errorf("shape.IsFull() = true, want false") |
| 250 | } |
| 251 | if shape.ReferencePoint().Contained { |
| 252 | t.Errorf("shape.ReferencePoint().Contained = true, want false") |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | func TestLoopHoleAndSign(t *testing.T) { |
| 257 | l := LoopFromPoints(parsePoints("0:-180, 0:-90, 0:0, 0:90")) |
nothing calls this directly
no test coverage detected
searching dependent graphs…