goccy / go-json

Fast JSON encoder/decoder compatible with encoding/json for Go
MIT License
3.12k stars 148 forks source link

Tests failures on s390x #466

Open eclipseo opened 1 year ago

eclipseo commented 1 year ago

Probably some big-endian issue in the code

Testing    in: /builddir/build/BUILD/go-json-0.10.2/_build/src
         PATH: /builddir/build/BUILD/go-json-0.10.2/_build/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
       GOPATH: /builddir/build/BUILD/go-json-0.10.2/_build:/usr/share/gocode
  GO111MODULE: off
      command: go test -buildmode pie -compiler gc -ldflags " -X github.com/goccy/go-json/version=0.10.2 -extldflags '-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes  '"
      testing: github.com/goccy/go-json
github.com/goccy/go-json
--- FAIL: TestUnmarshalMarshal (0.13s)
    decode_test.go:1903: Unmarshal: json: string unexpected end of JSON input
--- FAIL: TestUnmarshalRescanLiteralMangledUnquote (0.00s)
    decode_test.go:2805: Unmarshal unexpected error: invalid character '�' looking for beginning of value
--- FAIL: TestHTMLEscape (0.00s)
    encode_test.go:1377: HTMLEscape(&b, []byte(m)) = {"M":"<html\u003efoo \u0026\u2028 \u2029\u003c/html\u003e"}; want {"M":"\u003chtml\u003efoo \u0026\u2028 \u2029\u003c/html\u003e"}
--- FAIL: TestCompactBig (0.09s)
    json_test.go:201: Compact: json: string unexpected end of JSON input
--- FAIL: TestIndentBig (0.10s)
    json_test.go:216: Indent1: json: string unexpected end of JSON input
--- FAIL: TestEncoderSetEscapeHTML (0.00s)
    stream_test.go:163: Encode(stringOption) = `{"bar":""\u003chtml\\u003efoobar\\u003c/html\\u003e\""}`, want `{"bar":"\"\\u003chtml\\u003efoobar\\u003c/html\\u003e\""}`
    stream_test.go:172: SetEscapeHTML(false) Encode(stringOption) = `{"bar":""<html>foobar</html>\""}`, want `{"bar":"\"<html>foobar</html>\""}`
FAIL
exit status 1
FAIL    github.com/goccy/go-json    0.847s
gibmat commented 5 months ago

Just encountered this in Debian on s390x as well (full build logs). This library is a relatively recent addition to the MinIO dependency tree, which I've bumped into as I'm updating some of those packages in Debian.