]> Cypherpunks.ru repositories - gostls13.git/commitdiff
reflect: add a floating point section to DeepEqual tests
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 13 Sep 2021 19:49:08 +0000 (12:49 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 13 Sep 2021 20:17:35 +0000 (20:17 +0000)
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 <josharian@gmail.com>
Trust: Joe Tsai <joetsai@digital-static.net>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Joe Tsai <joetsai@digital-static.net>
Reviewed-by: Joe Tsai <joetsai@digital-static.net>
TryBot-Result: Go Bot <gobot@golang.org>

src/reflect/all_test.go

index 5b147082bb1f2befa1db79ffbf1a8d9b44f60976..22885c548f5ddef19f7dca810513cf5b98ef686b 100644 (file)
@@ -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},