summaryrefslogtreecommitdiff
path: root/test/bigdecimal/test_bigdecimal.rb
diff options
context:
space:
mode:
authorKenta Murata <mrkn@mrkn.jp>2021-01-06 18:17:35 +0900
committerKenta Murata <mrkn@mrkn.jp>2021-01-07 10:20:40 +0900
commit82f6085b3edaa41be4121b218b48100d4bf78670 (patch)
treee0fcd2afa1c8129a8197017c4df27b741259c6ca /test/bigdecimal/test_bigdecimal.rb
parent698d7947c300a5f5d63965fb2ccce59601f2563b (diff)
[ruby/bigdecimal] Fix trailing zero handling in rb_uint64_convert_to_BigDecimal
https://github.com/ruby/bigdecimal/commit/2056604d56
Diffstat (limited to 'test/bigdecimal/test_bigdecimal.rb')
-rw-r--r--test/bigdecimal/test_bigdecimal.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb
index 74c991f..fbe0d7e 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -1951,6 +1951,10 @@ class TestBigDecimal < Test::Unit::TestCase
assert_equal(1, BigDecimal(-1).precision)
assert_equal(2, BigDecimal(10).precision)
assert_equal(2, BigDecimal(-10).precision)
+ assert_equal(9, BigDecimal(100_000_000).precision)
+ assert_equal(9, BigDecimal(-100_000_000).precision)
+ assert_equal(12, BigDecimal(100_000_000_000).precision)
+ assert_equal(12, BigDecimal(-100_000_000_000).precision)
assert_equal(21, BigDecimal(100_000_000_000_000_000_000).precision)
assert_equal(21, BigDecimal(-100_000_000_000_000_000_000).precision)
assert_equal(103, BigDecimal("111e100").precision)