Skip to content

Commit

Permalink
add support for math/big.Int
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrre committed Mar 1, 2025
1 parent 4970117 commit 2e53198
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions _assertauto/Test/MathBigInt/Default.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[*math/big.Int] => .String() => (len=3) "123"
========== assertauto ==========
[github.com/pierrre/assert/assertauto.allocsPerRun] {
Runs: [int] 100,
Allocs: [float64] 2,
}
1 change: 1 addition & 0 deletions common.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func NewCommonValueWriter() *CommonValueWriter {
vw.Stringer = NewStringerValueWriter()
vw.Iter = NewIterValueWriter(vw)
vw.Kind = NewKindValueWriter(vw)
vw.ByTypeValueWriters["*math/big.Int"] = vw.Stringer
return vw
}

Expand Down
14 changes: 14 additions & 0 deletions math_big_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package pretty_test

import (
"math/big"
)

func init() {
addTestCasesPrefix("MathBigInt", []*testCase{
{
name: "Default",
value: big.NewInt(123),
},
})
}

0 comments on commit 2e53198

Please sign in to comment.