Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/reflect/all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,21 @@ type structWithSelfPtr struct {
s string
}

type deepEqualInterface interface {
Foo()
}

type deepEqualConcrete struct {
int
}

func (deepEqualConcrete) Foo() {}

var (
deepEqualConcrete1 = deepEqualConcrete{1}
deepEqualConcrete2 = deepEqualConcrete{2}
)

func init() {
loop1 = &loop2
loop2 = &loop1
Expand Down Expand Up @@ -1115,6 +1130,7 @@ var deepEqualTests = []DeepEqualTest{
{[]byte{1, 2, 3}, []byte{1, 2, 3}, true},
{[]MyByte{1, 2, 3}, []MyByte{1, 2, 3}, true},
{MyBytes{1, 2, 3}, MyBytes{1, 2, 3}, true},
{map[deepEqualInterface]string{deepEqualConcrete1: "a"}, map[deepEqualInterface]string{deepEqualConcrete1: "a"}, true},

// Inequalities
{1, 2, false},
Expand All @@ -1136,6 +1152,7 @@ var deepEqualTests = []DeepEqualTest{
{fn3, fn3, false},
{[][]int{{1}}, [][]int{{2}}, false},
{&structWithSelfPtr{p: &structWithSelfPtr{s: "a"}}, &structWithSelfPtr{p: &structWithSelfPtr{s: "b"}}, false},
{map[deepEqualInterface]string{deepEqualConcrete1: "a"}, map[deepEqualInterface]string{deepEqualConcrete2: "a"}, false},

// Fun with floating point.
{math.NaN(), math.NaN(), false},
Expand Down
Loading