summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-11-18 18:45:38 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-11-21 14:38:13 +0900
commit1974aa0f723bb1971d46ea2185d6b2f4c6581d55 (patch)
tree22a0dbb8cc12a04d01d61491753aa92f1f4f6d9d /test
parent5f7eb20256bfd5ba9c7ce4f400401c9253eb8439 (diff)
downloadmruby-1974aa0f723bb1971d46ea2185d6b2f4c6581d55.tar.gz
mruby-1974aa0f723bb1971d46ea2185d6b2f4c6581d55.zip
Update `Float#to_s` to keep trailing zero as CRuby does; ref 68cebb6
Diffstat (limited to 'test')
-rw-r--r--test/t/float.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/t/float.rb b/test/t/float.rb
index e2a8a5088..b69cae2fb 100644
--- a/test/t/float.rb
+++ b/test/t/float.rb
@@ -212,10 +212,10 @@ assert('Float#to_s') do
assert_equal("Infinity", Float::INFINITY.to_s)
assert_equal("-Infinity", (-Float::INFINITY).to_s)
assert_equal("NaN", Float::NAN.to_s)
- assert_equal("0", 0.0.to_s)
- assert_equal("-0", -0.0.to_s)
+ assert_equal("0.0", 0.0.to_s)
+ assert_equal("-0.0", -0.0.to_s)
assert_equal("-3.25", -3.25.to_s)
- assert_equal("50", 50.0.to_s)
+ assert_equal("50.0", 50.0.to_s)
assert_equal("0.0125", 0.0125.to_s)
assert_equal("-0.0125", -0.0125.to_s)
assert_equal("1.0e-10", 0.0000000001.to_s)
@@ -224,8 +224,8 @@ assert('Float#to_s') do
assert_equal("-1.0e+20", -1e20.to_s)
assert_equal("1.0e+16", 10000000000000000.0.to_s)
assert_equal("-1.0e+16", -10000000000000000.0.to_s)
- assert_equal("100000", 100000.0.to_s)
- assert_equal("-100000", -100000.0.to_s)
+ assert_equal("100000.0", 100000.0.to_s)
+ assert_equal("-100000.0", -100000.0.to_s)
if uses_float
assert_equal("1.0e+08", 100000000.0.to_s)
assert_equal("-1.0e+08", -100000000.0.to_s)
@@ -234,8 +234,8 @@ assert('Float#to_s') do
else
assert_equal("1.0e+15", 1000000000000000.0.to_s)
assert_equal("-1.0e+15", -1000000000000000.0.to_s)
- assert_equal("100000000000000", 100000000000000.0.to_s)
- assert_equal("-100000000000000", -100000000000000.0.to_s)
+ assert_equal("100000000000000.0", 100000000000000.0.to_s)
+ assert_equal("-100000000000000.0", -100000000000000.0.to_s)
end
end