diff options
Diffstat (limited to 'test/ruby/test_sprintf.rb')
| -rw-r--r-- | test/ruby/test_sprintf.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_sprintf.rb b/test/ruby/test_sprintf.rb index 1d3badddf9..66ae4db853 100644 --- a/test/ruby/test_sprintf.rb +++ b/test/ruby/test_sprintf.rb @@ -172,6 +172,10 @@ class TestSprintf < Test::Unit::TestCase assert_equal("x"*10+" 1.0", sprintf("x"*10+"%8.1f", 1r)) end + def test_rational_precision + assert_match(/\A0\.\d{600}\z/, sprintf("%.600f", 600**~60)) + end + def test_hash options = {:capture=>/\d+/} assert_equal("with options {:capture=>/\\d+/}", sprintf("with options %p" % options)) |
