summaryrefslogtreecommitdiff
path: root/test/ruby/test_rational.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_rational.rb')
-rw-r--r--test/ruby/test_rational.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb
index 9651f46f01..e40de141b5 100644
--- a/test/ruby/test_rational.rb
+++ b/test/ruby/test_rational.rb
@@ -880,6 +880,16 @@ class Rational_Test < Test::Unit::TestCase
assert_equal(1152921470247108503, 1073741789.lcm(1073741827))
end
+ def test_gcd_no_memory_leak
+ assert_no_memory_leak([], "#{<<-"begin;"}", "#{<<-"end;"}", limit: 1.2, rss: true)
+ x = (1<<121) + 1
+ y = (1<<99) + 1
+ 1000.times{x.gcd(y)}
+ begin;
+ 100.times {1000.times{x.gcd(y)}}
+ end;
+ end
+
def test_supp
assert_predicate(1, :real?)
assert_predicate(1.1, :real?)