Skip to content

Commit f93a63a

Browse files
committed
reflect: add a floating point section to DeepEqual tests
The floating point tests were all added into the Inequalities section, instead of separated into Equalities vs Inequalities. Rather than separate them, add a new floating point section. Change-Id: I3713a5aff5850dcc0caf68a754633d695a03ded9 Reviewed-on: https://go-review.googlesource.com/c/go/+/349612 Trust: Josh Bleecher Snyder <[email protected]> Trust: Joe Tsai <[email protected]> Run-TryBot: Josh Bleecher Snyder <[email protected]> Run-TryBot: Joe Tsai <[email protected]> Reviewed-by: Joe Tsai <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent a0c409c commit f93a63a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/reflect/all_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,14 +928,16 @@ var deepEqualTests = []DeepEqualTest{
928928
{fn1, fn3, false},
929929
{fn3, fn3, false},
930930
{[][]int{{1}}, [][]int{{2}}, false},
931+
{&structWithSelfPtr{p: &structWithSelfPtr{s: "a"}}, &structWithSelfPtr{p: &structWithSelfPtr{s: "b"}}, false},
932+
933+
// Fun with floating point.
931934
{math.NaN(), math.NaN(), false},
932935
{&[1]float64{math.NaN()}, &[1]float64{math.NaN()}, false},
933936
{&[1]float64{math.NaN()}, self{}, true},
934937
{[]float64{math.NaN()}, []float64{math.NaN()}, false},
935938
{[]float64{math.NaN()}, self{}, true},
936939
{map[float64]float64{math.NaN(): 1}, map[float64]float64{1: 2}, false},
937940
{map[float64]float64{math.NaN(): 1}, self{}, true},
938-
{&structWithSelfPtr{p: &structWithSelfPtr{s: "a"}}, &structWithSelfPtr{p: &structWithSelfPtr{s: "b"}}, false},
939941

940942
// Nil vs empty: not the same.
941943
{[]int{}, []int(nil), false},

0 commit comments

Comments
 (0)