aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2021-07-22 16:14:42 -0700
committerGitHub <noreply@github.com>2021-07-22 16:14:42 -0700
commit395a0ac549058d781199661ca2e37cc636db43e4 (patch)
treedb4392a8a97c8e946c405f06405d60c0de0977a8
parent402949e8139bb890c71a707b6faf6dd05c92f4e5 (diff)
downloadgo-cmp-395a0ac549058d781199661ca2e37cc636db43e4.tar.gz
Use sha256 in test (#268)
Some aggressive dependency checks flag the use of md5. Switch to sha256 as it accomplishes the same purpose.
-rw-r--r--cmp/compare_test.go6
-rw-r--r--cmp/testdata/diffs8
2 files changed, 8 insertions, 6 deletions
diff --git a/cmp/compare_test.go b/cmp/compare_test.go
index a435209..5cdce37 100644
--- a/cmp/compare_test.go
+++ b/cmp/compare_test.go
@@ -6,7 +6,7 @@ package cmp_test
import (
"bytes"
- "crypto/md5"
+ "crypto/sha256"
"encoding/json"
"errors"
"flag"
@@ -476,8 +476,8 @@ func comparerTests() []test {
reason: "comparer for fmt.Stringer used to compare differing types with different strings",
}, {
label: label + "/DifferingHash",
- x: md5.Sum([]byte{'a'}),
- y: md5.Sum([]byte{'b'}),
+ x: sha256.Sum256([]byte{'a'}),
+ y: sha256.Sum256([]byte{'b'}),
wantEqual: false,
reason: "hash differs",
}, {
diff --git a/cmp/testdata/diffs b/cmp/testdata/diffs
index 96ea191..afc7366 100644
--- a/cmp/testdata/diffs
+++ b/cmp/testdata/diffs
@@ -38,9 +38,11 @@
)
>>> TestDiff/Comparer/StringerInequal
<<< TestDiff/Comparer/DifferingHash
- [16]uint8{
-- 0x0c, 0xc1, 0x75, 0xb9, 0xc0, 0xf1, 0xb6, 0xa8, 0x31, 0xc3, 0x99, 0xe2, 0x69, 0x77, 0x26, 0x61,
-+ 0x92, 0xeb, 0x5f, 0xfe, 0xe6, 0xae, 0x2f, 0xec, 0x3a, 0xd7, 0x1c, 0x77, 0x75, 0x31, 0x57, 0x8f,
+ [32]uint8{
+- 0xca, 0x97, 0x81, 0x12, 0xca, 0x1b, 0xbd, 0xca, 0xfa, 0xc2, 0x31, 0xb3, 0x9a, 0x23, 0xdc, 0x4d,
+- 0xa7, 0x86, 0xef, 0xf8, 0x14, 0x7c, 0x4e, 0x72, 0xb9, 0x80, 0x77, 0x85, 0xaf, 0xee, 0x48, 0xbb,
++ 0x3e, 0x23, 0xe8, 0x16, 0x00, 0x39, 0x59, 0x4a, 0x33, 0x89, 0x4f, 0x65, 0x64, 0xe1, 0xb1, 0x34,
++ 0x8b, 0xbd, 0x7a, 0x00, 0x88, 0xd4, 0x2c, 0x4a, 0xcb, 0x73, 0xee, 0xae, 0xd5, 0x9c, 0x00, 0x9d,
}
>>> TestDiff/Comparer/DifferingHash
<<< TestDiff/Comparer/NilStringer