From: Meng Zhuo Date: Mon, 7 Oct 2019 03:30:01 +0000 (+0800) Subject: bytes: add endian base compare test X-Git-Tag: go1.14beta1~839 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=fc2915fabdda25912058b4e51b385e73e8ed2b4b;p=gostls13.git bytes: add endian base compare test The current bytes test suit didn't come with endian based test which causing #34549 can passed the try-bot. This test will failed when little endian architecture simply using load and compare uint. Update #34549 Change-Id: I0973c2cd505ce21c2bed1deeb7d526f1e872118d Reviewed-on: https://go-review.googlesource.com/c/go/+/198358 Reviewed-by: Cherry Zhang Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot --- diff --git a/src/bytes/compare_test.go b/src/bytes/compare_test.go index a321f2e086..a595d575d0 100644 --- a/src/bytes/compare_test.go +++ b/src/bytes/compare_test.go @@ -120,6 +120,39 @@ func TestCompareBytes(t *testing.T) { } } +func TestEndianBaseCompare(t *testing.T) { + // This test compares byte slices that are almost identical, except one + // difference that for some j, a[j]>b[j] and a[j+1]