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:
parent
1711b54b7b
commit
bf2321412a
@ -359,6 +359,8 @@ class TestCoverage < Test::Unit::TestCase
|
|||||||
def test_method_coverage_for_define_method
|
def test_method_coverage_for_define_method
|
||||||
result = {
|
result = {
|
||||||
:methods => {
|
:methods => {
|
||||||
|
[Object, :a, 6, 18, 6, 25] => 2,
|
||||||
|
[Object, :b, 7, 18, 8, 3] => 0,
|
||||||
[Object, :bar, 2, 20, 3, 1] => 1,
|
[Object, :bar, 2, 20, 3, 1] => 1,
|
||||||
[Object, :baz, 4, 9, 4, 11] => 0,
|
[Object, :baz, 4, 9, 4, 11] => 0,
|
||||||
[Object, :foo, 1, 20, 1, 22] => 2,
|
[Object, :foo, 1, 20, 1, 22] => 2,
|
||||||
@ -370,10 +372,15 @@ class TestCoverage < Test::Unit::TestCase
|
|||||||
}
|
}
|
||||||
f = proc {}
|
f = proc {}
|
||||||
define_method(:baz, &f)
|
define_method(:baz, &f)
|
||||||
|
define_method(:a) do; end
|
||||||
|
define_method(:b) do
|
||||||
|
end
|
||||||
|
|
||||||
foo
|
foo
|
||||||
foo
|
foo
|
||||||
bar
|
bar
|
||||||
|
a
|
||||||
|
a
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user