From f93a63addbbca69d7817c8993a88511ec31424cd Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Mon, 13 Sep 2021 12:49:08 -0700 Subject: 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 Trust: Joe Tsai Run-TryBot: Josh Bleecher Snyder Run-TryBot: Joe Tsai Reviewed-by: Joe Tsai TryBot-Result: Go Bot --- src/reflect/all_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/reflect/all_test.go b/src/reflect/all_test.go index 5b147082bb..22885c548f 100644 --- a/src/reflect/all_test.go +++ b/src/reflect/all_test.go @@ -928,6 +928,9 @@ var deepEqualTests = []DeepEqualTest{ {fn1, fn3, false}, {fn3, fn3, false}, {[][]int{{1}}, [][]int{{2}}, false}, + {&structWithSelfPtr{p: &structWithSelfPtr{s: "a"}}, &structWithSelfPtr{p: &structWithSelfPtr{s: "b"}}, false}, + + // Fun with floating point. {math.NaN(), math.NaN(), false}, {&[1]float64{math.NaN()}, &[1]float64{math.NaN()}, false}, {&[1]float64{math.NaN()}, self{}, true}, @@ -935,7 +938,6 @@ var deepEqualTests = []DeepEqualTest{ {[]float64{math.NaN()}, self{}, true}, {map[float64]float64{math.NaN(): 1}, map[float64]float64{1: 2}, false}, {map[float64]float64{math.NaN(): 1}, self{}, true}, - {&structWithSelfPtr{p: &structWithSelfPtr{s: "a"}}, &structWithSelfPtr{p: &structWithSelfPtr{s: "b"}}, false}, // Nil vs empty: not the same. {[]int{}, []int(nil), false}, -- cgit v1.2.3-54-g00ecf