Skip to content

Commit b3b5807

Browse files
authored
chore: Add in gomock Matches receiver func
1 parent 08afb35 commit b3b5807

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

decimal.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2333,3 +2333,14 @@ func (d Decimal) Tan() Decimal {
23332333
}
23342334
return y
23352335
}
2336+
2337+
// Matches is a gomock match helper.
2338+
// It allows for equal numbers with different internal representations to match successfully in tests.
2339+
func (d Decimal) Matches(other {}interface) bool {
2340+
otherDecimal, ok := other.(Decimal)
2341+
if !ok {
2342+
return false
2343+
}
2344+
2345+
return d.Equal(otherDecimal)
2346+
}

0 commit comments

Comments
 (0)