Skip to content

Commit

Permalink
Move
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed Jun 26, 2024
1 parent 14e5e04 commit 77f2451
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/debezium/decimal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ func mustParseDecimal(value string) *apd.Decimal {
func TestEncodeDecimal(t *testing.T) {
testEncodeDecimal := func(value string, expectedScale int32) {
bytes, scale := EncodeDecimal(mustParseDecimal(value))
assert.Equal(t, expectedScale, scale, value)

actual := DecodeDecimal(bytes, scale)
assert.Equal(t, value, actual.String(), value)
assert.Equal(t, expectedScale, -actual.Exponent, value)
assert.Equal(t, expectedScale, scale, value)
}

testEncodeDecimal("0", 0)
Expand Down

0 comments on commit 77f2451

Please sign in to comment.