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
This commit is contained in:
nobu 2017-03-16 03:35:29 +00:00
parent 62fb6147cd
commit a2ac0982cd
2 changed files with 19 additions and 8 deletions

View file

@ -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