diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-16 03:35:29 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-16 03:35:29 +0000 |
commit | a2ac0982cd5fc48ba3cafe3c9bdc48836eaa0bce (patch) | |
tree | eb1c81ee29375e93bb9cbb58029d160347f91e21 /test | |
parent | 62fb6147cde44c2c697ea8c160b724d029e1cd87 (diff) | |
download | ruby-a2ac0982cd5fc48ba3cafe3c9bdc48836eaa0bce.tar.gz |
rational.c: float denom
* rational.c (parse_rat): allow float as a denominator as well as
a numerator. [ruby-core:79104] [Bug #13134]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_rational.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb index 43bd750615..be90bf85bf 100644 --- a/test/ruby/test_rational.rb +++ b/test/ruby/test_rational.rb @@ -747,6 +747,19 @@ class Rational_Test < Test::Unit::TestCase ng[ 5, 1, '5e_1'] ng[50, 1, '5e1_'] + ok[ 50, 33, '5/3.3'] + ok[ 5, 3, '5/3e0'] + ok[ 5, 30, '5/3e1'] + ng[ 5, 3, '5/3._3'] + ng[ 50, 33, '5/3.3_'] + ok[500,333, '5/3.3_3'] + ng[ 5, 3, '5/3e'] + ng[ 5, 3, '5/3_e'] + ng[ 5, 3, '5/3e_'] + ng[ 5, 3, '5/3e_1'] + ng[ 5, 30, '5/3e1_'] + ok[ 5, 300000000000, '5/3e1_1'] + ng[0, 1, ''] ng[0, 1, ' '] ng[5, 1, "\f\n\r\t\v5\0"] @@ -756,7 +769,6 @@ class Rational_Test < Test::Unit::TestCase ng[5, 1, '5x'] ng[5, 1, '5/_3'] ng[5, 3, '5/3_'] - ng[5, 3, '5/3.3'] ng[5, 3, '5/3x'] end |