This is an automated email from the ASF dual-hosted git repository.
zeroshade pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-go.git
The following commit(s) were added to refs/heads/main by this push:
new 35d54882 fix(internal): fix assertion on undefined behavior (#602)
35d54882 is described below
commit 35d5488221cbe31b2ee35ff2a81179598716840d
Author: Bryce Mecum <[email protected]>
AuthorDate: Tue Dec 9 09:17:20 2025 -0800
fix(internal): fix assertion on undefined behavior (#602)
### Rationale for this change
Prior to this PR, `TestMul_64bit` in `internal/utils/math_64bit_test.go`
fails on macOS aarch64. This wasn't caught on CI because there's no CI
job for macOS aarch64. The behavior under test is technically undefined
behavior (`int(NaN)` is UB).
### What changes are included in this PR?
Just to keep the change small, I did the minimum necessary to make the
assertion pass on all platforms.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
No.
Closes https://github.com/apache/arrow-go/issues/413
---
internal/utils/math_64bit_test.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/internal/utils/math_64bit_test.go
b/internal/utils/math_64bit_test.go
index 0d9f987d..ba669a0c 100644
--- a/internal/utils/math_64bit_test.go
+++ b/internal/utils/math_64bit_test.go
@@ -28,7 +28,7 @@ import (
func TestMul_64bit(t *testing.T) {
// These constants are smaller in magnitude than the exact square root.
- assert.Greater(t, sqrtMinInt, int(math.Sqrt(math.MinInt64)))
+ assert.Greater(t, sqrtMinInt, -int(math.Sqrt(math.MaxInt64)))
assert.Less(t, sqrtMaxInt, int(math.Sqrt(math.MaxInt64)))
for _, tt := range []struct {