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

Function TestLoopEqual

s2/loop_test.go:652–715  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

650}
651
652func TestLoopEqual(t *testing.T) {
653 tests := []struct {
654 a, b *Loop
655 want bool
656 }{
657 {
658 a: EmptyLoop(),
659 b: EmptyLoop(),
660 want: true,
661 },
662 {
663 a: FullLoop(),
664 b: FullLoop(),
665 want: true,
666 },
667 {
668 a: EmptyLoop(),
669 b: FullLoop(),
670 want: false,
671 },
672 {
673 a: candyCane,
674 b: candyCane,
675 want: true,
676 },
677 {
678 a: candyCane,
679 b: rotate(candyCane),
680 want: false,
681 },
682 {
683 a: candyCane,
684 b: rotate(rotate(candyCane)),
685 want: false,
686 },
687 {
688 a: candyCane,
689 b: rotate(rotate(rotate(candyCane))),
690 want: false,
691 },
692 {
693 a: candyCane,
694 b: rotate(rotate(rotate(rotate(candyCane)))),
695 want: false,
696 },
697 {
698 a: candyCane,
699 b: rotate(rotate(rotate(rotate(rotate(candyCane))))),
700 want: false,
701 },
702 {
703 // candyCane has 6 points, so 6 rotates should line up again.
704 a: candyCane,
705 b: rotate(rotate(rotate(rotate(rotate(rotate(candyCane)))))),
706 want: true,
707 },
708 }
709

Callers

nothing calls this directly

Calls 4

EmptyLoopFunction · 0.85
FullLoopFunction · 0.85
rotateFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…