mruby-sprintf: reduce float digits to avoid test failure.

Too many digits to fit in single precision float numbers, so that tests
fail when `MRB_USE_FLOAT32` defined.
parent 5c7fe225
...@@ -10,11 +10,11 @@ assert('String#%') do ...@@ -10,11 +10,11 @@ assert('String#%') do
assert_equal 15, ("%b" % (1<<14)).size assert_equal 15, ("%b" % (1<<14)).size
skip unless Object.const_defined?(:Float) skip unless Object.const_defined?(:Float)
assert_equal "1.0", "%3.1f" % 1.01 assert_equal "1.0", "%3.1f" % 1.01
assert_equal " 1234567.12", "% 4.2f" % 1234567.123456789 assert_equal " 12345.12", "% 4.2f" % 12345.1234
assert_equal "1234567.12", "%-4.2f" % 1234567.123456789 assert_equal "12345.12", "%-4.2f" % 12345.12345
assert_equal "+1234567.12", "%+4.2f" % 1234567.123456789 assert_equal "+12345.12", "%+4.2f" % 12345.1234
assert_equal "1234567.12", "%04.2f" % 1234567.123456789 assert_equal "12345.12", "%04.2f" % 12345.12345
assert_equal "00000000001234567.12", "%020.2f" % 1234567.123456789 assert_equal "0012345.12", "%010.2f" % 12345.1234
end end
assert('String#% with inf') do assert('String#% with inf') do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment