1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

ext/coverage/coverage.c: Add test cases

* ext/coverage/coverage.c (test_method_coverage_for_define_method):
  Add test cases for method coverages which test do-end block
  define_method.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yui-knk 2017-12-12 13:19:40 +00:00
parent 1711b54b7b
commit bf2321412a

View file

@ -359,6 +359,8 @@ class TestCoverage < Test::Unit::TestCase
def test_method_coverage_for_define_method
result = {
:methods => {
[Object, :a, 6, 18, 6, 25] => 2,
[Object, :b, 7, 18, 8, 3] => 0,
[Object, :bar, 2, 20, 3, 1] => 1,
[Object, :baz, 4, 9, 4, 11] => 0,
[Object, :foo, 1, 20, 1, 22] => 2,
@ -370,10 +372,15 @@ class TestCoverage < Test::Unit::TestCase
}
f = proc {}
define_method(:baz, &f)
define_method(:a) do; end
define_method(:b) do
end
foo
foo
bar
a
a
end;
end