mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 04:24:04 +02:00
cdhash_cmp: rational literals with fractions
Nobu kindly pointed out that rational literals can have fractions.
This commit is contained in:
parent
2bc293e899
commit
d0e6c6e682
Notes:
git
2021-05-12 10:31:14 +09:00
2 changed files with 7 additions and 2 deletions
|
@ -835,6 +835,10 @@ class Rational_Test < Test::Unit::TestCase
|
|||
n = case 1 when 2r then false else true end
|
||||
assert_equal(n, true, '[ruby-core:103759] [Bug #17854]')
|
||||
RUBY
|
||||
assert_separately([], <<-RUBY)
|
||||
n = case 3/2r when 1.5r then true else false end
|
||||
assert_equal(n, true, '[ruby-core:103759] [Bug #17854]')
|
||||
RUBY
|
||||
end
|
||||
|
||||
def test_Rational_with_invalid_exception
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue