Skip to content

Commit c27cea1

Browse files
committed
codec: json test: skip portion of test that fails on i386 when running on that arch
1 parent d5f6822 commit c27cea1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

codec/json_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"io"
1111
"math"
1212
"reflect"
13+
"runtime"
1314
"strconv"
1415
"strings"
1516
"testing"
@@ -622,7 +623,10 @@ func doTestJsonTimeAndBytesOptions(t *testing.T, h Handle) {
622623
{[]string{}, []string{}, `{"Bytes":"c29tZSByZWFsbHkgcmVhbGx5IGNvb2wgbmFtZXMgdGhhdCBhcmUgbmlnZXJpYW4gYW5kIGFtZXJpY2FuIGxpa2UgInVnb3JqaSBtZWxvZHkgbndva2UiIC0gZ2V0IGl0PyA=","Time":"2025-06-19T14:32:49Z"}`},
623624
{[]string{time.RFC3339, time.RFC1123Z}, []string{"array"}, `{"Bytes":[115,111,109,101,32,114,101,97,108,108,121,32,114,101,97,108,108,121,32,99,111,111,108,32,110,97,109,101,115,32,116,104,97,116,32,97,114,101,32,110,105,103,101,114,105,97,110,32,97,110,100,32,97,109,101,114,105,99,97,110,32,108,105,107,101,32,34,117,103,111,114,106,105,32,109,101,108,111,100,121,32,110,119,111,107,101,34,32,45,32,103,101,116,32,105,116,63,32],"Time":"Thu, 19 Jun 2025 14:32:49 +0000"}`},
624625
{[]string{time.RFC1123Z, time.RFC850}, []string{"base32", "hex"}, `{"Bytes":"ONXW2ZJAOJSWC3DMPEQHEZLBNRWHSIDDN5XWYIDOMFWWK4ZAORUGC5BAMFZGKIDONFTWK4TJMFXCAYLOMQQGC3LFOJUWGYLOEBWGS23FEARHKZ3POJVGSIDNMVWG6ZDZEBXHO33LMURCALJAM5SXIIDJOQ7SA===","Time":"Thu, 19 Jun 2025 14:32:49 +0000"}`},
625-
{[]string{"unixmilli", time.RFC1123Z}, []string{"hex", "base32hex"}, `{"Bytes":"736f6d65207265616c6c79207265616c6c7920636f6f6c206e616d6573207468617420617265206e6967657269616e20616e6420616d65726963616e206c696b65202275676f726a69206d656c6f6479206e776f6b6522202d206765742069743f20","Time":1750343569000}`},
626+
}
627+
if runtime.GOARCH != "386" {
628+
// 386 only has 32 bits, and cannot adequately capture time-milli since 1970. skip it.
629+
table = append(table, params{[]string{"unixmilli", time.RFC1123Z}, []string{"hex", "base32hex"}, `{"Bytes":"736f6d65207265616c6c79207265616c6c7920636f6f6c206e616d6573207468617420617265206e6967657269616e20616e6420616d65726963616e206c696b65202275676f726a69206d656c6f6479206e776f6b6522202d206765742069743f20","Time":1750343569000}`})
626630
}
627631
for i, v := range table {
628632
jh.TimeFormat = v.TimeFormat

0 commit comments

Comments
 (0)