diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-09-07 22:25:08 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-09-07 22:27:30 +0900 |
| commit | 9d08025b8b0fc9828120d48c61bde9c4ba49ce74 (patch) | |
| tree | 12642f98ff9f0a9407af5f3dd3e5646d0f83d86b /test | |
| parent | 8f04d6561f0d8cb0f631d53d435e1522009a0a0e (diff) | |
| download | mruby-9d08025b8b0fc9828120d48c61bde9c4ba49ce74.tar.gz mruby-9d08025b8b0fc9828120d48c61bde9c4ba49ce74.zip | |
Revert part of #4225
Since in mruby, Integer and Float interchange frequently (mostly on
overflow), so adding explicit `.0` can cause problems sometimes.
For example:
https://github.com/mattn/mruby-json/pull/40
https://github.com/pepabo/mruby-msd/pull/13
https://github.com/mattn/mruby-json/pull/42
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/float.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/t/float.rb b/test/t/float.rb index 63bf83f40..dc989636f 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.0.to_s) - assert_equal("-0.0", -0.0.to_s) + assert_equal("0", 0.0.to_s) + assert_equal("-0", -0.0.to_s) assert_equal("-3.25", -3.25.to_s) - assert_equal("50.0", 50.0.to_s) + assert_equal("50", 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.0", 100000.0.to_s) - assert_equal("-100000.0", -100000.0.to_s) + assert_equal("100000", 100000.0.to_s) + assert_equal("-100000", -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.0", 100000000000000.0.to_s) - assert_equal("-100000000000000.0", -100000000000000.0.to_s) + assert_equal("100000000000000", 100000000000000.0.to_s) + assert_equal("-100000000000000", -100000000000000.0.to_s) end end |
