mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Test coverage of extending stack and overflow
This commit is contained in:
@@ -438,3 +438,15 @@ assert('Kernel#respond_to_missing?') do
|
|||||||
assert_true Test4RespondToMissing.new.respond_to?(:a_method)
|
assert_true Test4RespondToMissing.new.respond_to?(:a_method)
|
||||||
assert_false Test4RespondToMissing.new.respond_to?(:no_method)
|
assert_false Test4RespondToMissing.new.respond_to?(:no_method)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
assert('stack extend') do
|
||||||
|
def recurse(count, stop)
|
||||||
|
return count if count > stop
|
||||||
|
recurse(count+1, stop)
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_equal 61, recurse(0, 60)
|
||||||
|
assert_raise RuntimeError do
|
||||||
|
recurse(0, 100000)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user