diff options
author | Josh Bleecher Snyder <josharian@gmail.com> | 2021-09-13 12:49:08 -0700 |
---|---|---|
committer | Josh Bleecher Snyder <josharian@gmail.com> | 2021-09-13 20:17:35 +0000 |
commit | f93a63addbbca69d7817c8993a88511ec31424cd (patch) | |
tree | f9ae9d892d05537f04d8b952929d01b7ab8179f9 | |
parent | a0c409cbc82ea9999a03fa0bfe6d9a8953e780e0 (diff) | |
download | go-f93a63addbbca69d7817c8993a88511ec31424cd.tar.gz go-f93a63addbbca69d7817c8993a88511ec31424cd.zip |
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 <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>
-rw-r--r-- | src/reflect/all_test.go | 4 |
1 files changed, 3 insertions, 1 deletions
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}, |