bkietz commented on code in PR #38426:
URL: https://github.com/apache/arrow/pull/38426#discussion_r1370181399
##########
go/arrow/decimal256/decimal256_test.go:
##########
@@ -575,3 +576,34 @@ func TestFromString(t *testing.T) {
})
}
}
+
+// Test issues from GH-38395
+func TestToString(t *testing.T) {
+ const decStr =
"3379334159166193114608287418738414931564221155305735605033949613740461239999"
+
+ integer, _ := (&big.Int{}).SetString(decStr, 10)
+ dec := decimal256.FromBigInt(integer)
+
+ expected := "0." + decStr
+ actual := dec.ToString(76)
Review Comment:
Nit:
```suggestion
actual := dec.ToString(len(decStr))
```
##########
go/arrow/decimal256/decimal256_test.go:
##########
@@ -575,3 +577,31 @@ func TestFromString(t *testing.T) {
})
}
}
+
Review Comment:
Could you add some tests which hit the bitlen overflow?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]