Skip to content

Commit 3f9bbfe

Browse files
authored
Fix the arbitrary generator for BigDecimal to allow negative scales (#5875)
1 parent 5be3b6a commit 3f9bbfe

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/sad-ideas-open.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"effect": patch
3+
---
4+
5+
Fix the arbitrary generator for BigDecimal to allow negative scales.

packages/effect/src/Schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7888,7 +7888,7 @@ const bigDecimalPretty = (): pretty_.Pretty<bigDecimal_.BigDecimal> => (val) =>
78887888
`BigDecimal(${bigDecimal_.format(bigDecimal_.normalize(val))})`
78897889

78907890
const bigDecimalArbitrary = (): LazyArbitrary<bigDecimal_.BigDecimal> => (fc) =>
7891-
fc.tuple(fc.bigInt(), fc.integer({ min: 0, max: 18 }))
7891+
fc.tuple(fc.bigInt(), fc.integer({ min: -18, max: 18 }))
78927892
.map(([value, scale]) => bigDecimal_.make(value, scale))
78937893

78947894
/**

0 commit comments

Comments
 (0)