diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-08-23 14:27:16 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2026-05-11 12:24:02 +0900 |
| commit | 793f4c9572b9d888f0d40fb9d4ec783ea23486e4 (patch) | |
| tree | 0b6262e4de08a1af4573c755d7b9303214061f0e /test | |
| parent | e08ec2b3882efc7f65f9834fa3bd9b63c10988a9 (diff) | |
[Bug #20697] Parse `r` suffix at Rational
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_rational.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb index e75e569106..a02e11acc5 100644 --- a/test/ruby/test_rational.rb +++ b/test/ruby/test_rational.rb @@ -130,6 +130,7 @@ class Rational_Test < Test::Unit::TestCase assert_equal(Rational(111, 10), Rational('1.11e1')) assert_equal(Rational(111, 100), Rational('1.11e0')) assert_equal(Rational(111, 1000), Rational('1.11e-1')) + assert_equal(Rational(5, 4), Rational('3.0r','2.4R')) end def test_conv_error @@ -842,6 +843,10 @@ class Rational_Test < Test::Unit::TestCase ng[5, 3, '5/3x'] ng[5, 1, '5/-3'] + + ok[30, 24, '3.0r/2.4R'] + ng[30, 24, '3.0r/2.4re1'] + ng[30, 240, '3.0r/2.4e1r'] end def test_parse_zero_denominator |
