labstack / gommon

Common packages for Go
MIT License
540 stars 101 forks source link

Adapt tests for arm64 #43

Open aderouineau opened 3 years ago

aderouineau commented 3 years ago

All tests for "EB" fail on arm64:

--- FAIL: TestBytesParse (0.00s)
    bytes_test.go:211:
            Error Trace:    bytes_test.go:211
            Error:          Should be true
            Test:           TestBytesParse
    bytes_test.go:215:
            Error Trace:    bytes_test.go:215
            Error:          Should be true
            Test:           TestBytesParse
    bytes_test.go:221:
            Error Trace:    bytes_test.go:221
            Error:          Should be true
            Test:           TestBytesParse
    bytes_test.go:225:
            Error Trace:    bytes_test.go:225
            Error:          Should be true
            Test:           TestBytesParse

This is because the conversion from float64 to int64 is implementation specific (see https://github.com/golang/go/issues/45588). The test on arm64 should be b == math.MaxInt64.

This change moves the "EB" tests in platform-specific test files.