MCPcopy
hub / github.com/golang/geo / TestPolygonInitSingleLoop

Function TestPolygonInitSingleLoop

s2/polygon_test.go:152–163  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

150)
151
152func TestPolygonInitSingleLoop(t *testing.T) {
153 if !PolygonFromLoops([]*Loop{EmptyLoop()}).IsEmpty() {
154 t.Errorf("polygon from Empty Loop should make an EmptyPolygon")
155 }
156 if !PolygonFromLoops([]*Loop{FullLoop()}).IsFull() {
157 t.Errorf("polygon from Full Loop should make a FullPolygon")
158 }
159 p := PolygonFromLoops([]*Loop{makeLoop("0:0, 0:10, 10:0")})
160 if got, want := p.numVertices, 3; got != want {
161 t.Errorf("%v.numVertices = %v, want %v", p, got, want)
162 }
163}
164
165func TestPolygonEmpty(t *testing.T) {
166 shape := emptyPolygon

Callers

nothing calls this directly

Calls 6

PolygonFromLoopsFunction · 0.85
EmptyLoopFunction · 0.85
FullLoopFunction · 0.85
makeLoopFunction · 0.85
IsEmptyMethod · 0.65
IsFullMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…