summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-12 13:23:29 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-12 13:23:29 +0000
commit8f79c623f39756cce4c8a81dc77d24972629ae7d (patch)
tree33f1ed85008ffddefce5baec1c82b3d1ec55d9bc
parentf603c4ae082cc7d5c5a6f11b2528240f31dafc88 (diff)
add tests for [ruby-dev:31189] and [ruby-dev:31190].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_fixnum.rb10
-rw-r--r--test/ruby/test_range.rb2
2 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_fixnum.rb b/test/ruby/test_fixnum.rb
index 57999d4b03..4cf73fb4c8 100644
--- a/test/ruby/test_fixnum.rb
+++ b/test/ruby/test_fixnum.rb
@@ -23,4 +23,14 @@ class TestFixnum < Test::Unit::TestCase
end
end
end
+
+ def test_succ
+ assert_equal(0x40000000, 0x3fffffff.succ, "[ruby-dev:31189]")
+ assert_equal(0x4000000000000000, 0x3fffffffffffffff.succ, "[ruby-dev:31190]")
+ end
+
+ def test_plus
+ assert_equal(0x4000000000000000, 0x3fffffffffffffff+1)
+ end
+
end
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb
index 31f7e29de4..3c24215c6a 100644
--- a/test/ruby/test_range.rb
+++ b/test/ruby/test_range.rb
@@ -50,5 +50,7 @@ class TestRange < Test::Unit::TestCase
assert_equal(2.0, (1.0..2.0).max)
assert_equal(nil, (2.0..1.0).max)
assert_raise(TypeError) { (1.0...2.0).max }
+
+ assert_equal(-0x80000002, ((-0x80000002)...(-0x80000001)).max)
end
end