summaryrefslogtreecommitdiff
path: root/test/-ext-/rational/test_rat.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/-ext-/rational/test_rat.rb')
-rw-r--r--test/-ext-/rational/test_rat.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/-ext-/rational/test_rat.rb b/test/-ext-/rational/test_rat.rb
index 626ffb9..dbba00c 100644
--- a/test/-ext-/rational/test_rat.rb
+++ b/test/-ext-/rational/test_rat.rb
@@ -29,4 +29,18 @@ class TestRational < Test::Unit::TestCase
rescue NotImplementedError
end
end
+
+ def test_rb_rational_raw
+ rat = Rational.raw(1, 2)
+ assert_equal(1, rat.numerator)
+ assert_equal(2, rat.denominator)
+
+ rat = Rational.raw(-1, 2)
+ assert_equal(-1, rat.numerator)
+ assert_equal(2, rat.denominator)
+
+ rat = Rational.raw(1, -2)
+ assert_equal(-1, rat.numerator)
+ assert_equal(2, rat.denominator)
+ end
end