diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-02 16:42:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-02 16:42:21 +0000 |
commit | 603f95a0ed37d90854f80393881fb38ab29128a7 (patch) | |
tree | 2f76d289cf541c53cb29dff917569d0846a12613 /test | |
parent | 25ea4dc6230f3141dcb3b9d04c9124bc07146bca (diff) |
Fix Rational of Float
[ruby-core:89239] [Bug #15189]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_integer.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/ruby/test_integer.rb b/test/ruby/test_integer.rb index acba5aca1a..a991683773 100644 --- a/test/ruby/test_integer.rb +++ b/test/ruby/test_integer.rb @@ -27,6 +27,29 @@ class TestInteger < Test::Unit::TestCase x = EnvUtil.suppress_warning {2 ** -0x4000000000000000} assert_in_delta(0.0, (x / 2), Float::EPSILON) + + <<~EXPRS.each_line.with_index(__LINE__+1) do |expr, line| + crash01: 111r+11**-11111161111111 + crash02: 1118111111111**-1111111111111111**1+1==11111 + crash03: -1111111**-1111*11 - -1111111** -111111111 + crash04: 1118111111111** -1111111111111111**1+11111111111**1 ===111 + crash05: 11** -111155555555555555 -55 !=5-555 + crash07: 1 + 111111111**-1111811111 + crash08: 18111111111**-1111111111111111**1 + 1111111111**-1111**1 + crash10: -7 - -1111111** -1111**11 + crash12: 1118111111111** -1111111111111111**1 + 1111 - -1111111** -1111*111111111119 + crash13: 1.0i - -1111111** -111111111 + crash14: 11111**111111111**111111 * -11111111111111111111**-111111111111 + crash15: ~1**1111 + -~1**~1**111 + crash17: 11** -1111111**1111 /11i + crash18: 5555i**-5155 - -9111111**-1111**11 + crash19: 111111*-11111111111111111111**-1111111111111111 + crash20: 1111**111-11**-11111**11 + crash21: 11**-10111111119-1i -1r + EXPRS + name, expr = expr.split(':', 2) + assert_ruby_status(%w"-W0", expr, name) + end end def test_lshift |