MCPcopy Create free account
hub / github.com/gonum/plot / TestExciseLoops

Function TestExciseLoops

plotter/contour_test.go:455–476  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

453}
454
455func TestExciseLoops(t *testing.T) {
456 for _, quick := range []bool{true, false} {
457 for i, test := range loopTests {
458 gotSet := make(contourSet)
459 c := &contour{
460 backward: slices.Clone(test.c.backward),
461 forward: slices.Clone(test.c.forward),
462 }
463 gotSet[c] = struct{}{}
464 c.exciseLoops(gotSet, quick)
465 var got []*contour
466 for c := range gotSet {
467 got = append(got, c)
468 }
469 sort.Sort(testContour(got))
470 if !reflect.DeepEqual(got, test.want) {
471 t.Errorf("unexpected loop excision result for %d quick=%t:\n\tgot:%v\n\twant:%v",
472 i, quick, testContour(got), testContour(test.want))
473 }
474 }
475 }
476}
477
478type testContour []*contour
479

Callers

nothing calls this directly

Calls 2

exciseLoopsMethod · 0.95
testContourTypeAlias · 0.85

Tested by

no test coverage detected