Add tests for BigDecimal internal representation methods (#9717)

This commit is contained in:
GregoryTravis 2024-04-18 16:42:41 -04:00 committed by GitHub
parent 0de490be24
commit 56ae80a66b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -943,6 +943,14 @@ add_specs suite_builder =
Math.min (Decimal.new "12E70") (Decimal.new "13E70") . should_equal (Decimal.new "12E70")
Math.max (Decimal.new "12E70") (Decimal.new "13E70") . should_equal (Decimal.new "13E70")
suite_builder.group "BigDecimal internal representation methods" group_builder->
group_builder.specify "internal accessors should work correctly" <|
d = Decimal.new "123.456"
d.precision . should_equal 6
d.scale . should_equal 3
d.unscaled_value . should_equal 123456
d.internal_representation . should_equal [123456, 6, 3]
main =
suite = Test.build suite_builder->
add_specs suite_builder