summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_rational.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb
index ff2d189eff..43bd750615 100644
--- a/test/ruby/test_rational.rb
+++ b/test/ruby/test_rational.rb
@@ -695,27 +695,43 @@ class Rational_Test < Test::Unit::TestCase
ok[-5, 1, '-5']
ok[ 5, 3, '5/3']
ok[-5, 3, '-5/3']
+ ok[ 5, 3, '5_5/33']
+ ok[ 5,33, '5/3_3']
+ ng[ 5, 1, '5__5/33']
+ ng[ 5, 3, '5/3__3']
ok[ 5, 1, '5.0']
ok[-5, 1, '-5.0']
ok[ 5, 3, '5.0/3']
ok[-5, 3, '-5.0/3']
+ ok[ 501,100, '5.0_1']
+ ok[ 501,300, '5.0_1/3']
+ ok[ 5,33, '5.0/3_3']
+ ng[ 5, 1, '5.0__1/3']
+ ng[ 5, 3, '5.0/3__3']
ok[ 5, 1, '5e0']
ok[-5, 1, '-5e0']
ok[ 5, 3, '5e0/3']
ok[-5, 3, '-5e0/3']
+ ok[550, 1, '5_5e1']
+ ng[ 5, 1, '5_e1']
ok[ 5e1, 1, '5e1']
ok[-5e2, 1, '-5e2']
ok[ 5e3, 3, '5e003/3']
ok[-5e4, 3, '-5e004/3']
+ ok[ 5e3, 1, '5e0_3']
+ ok[ 5e1,33, '5e1/3_3']
+ ng[ 5e0, 1, '5e0__3/3']
+ ng[ 5e1, 3, '5e1/3__3']
ok[ 33, 100, '.33']
ok[ 33, 100, '0.33']
ok[-33, 100, '-.33']
ok[-33, 100, '-0.33']
ok[-33, 100, '-0.3_3']
+ ng[ -3, 10, '-0.3__3']
ok[ 1, 2, '5e-1']
ok[50, 1, '5e+1']