Add test cases for branch coverage
* test/coverage/test_coverage.rb (test_branch_coverage_for_while_statement): Add test cases for modifier while/until. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3ee8e906b8
commit
8bbdbf9e75
@ -245,6 +245,8 @@ class TestCoverage < Test::Unit::TestCase
|
|||||||
:branches => {
|
:branches => {
|
||||||
[:while, 0, 2, 0] => {[:body, 1, 3, 2]=> 3},
|
[:while, 0, 2, 0] => {[:body, 1, 3, 2]=> 3},
|
||||||
[:until, 2, 5, 0] => {[:body, 3, 6, 2]=>10},
|
[:until, 2, 5, 0] => {[:body, 3, 6, 2]=>10},
|
||||||
|
[:while, 4, 10, 0] => {[:body, 5, 10, 0]=> 3},
|
||||||
|
[:until, 6, 11, 0] => {[:body, 7, 11, 0]=>10},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert_coverage(<<~"end;", { branches: true }, result)
|
assert_coverage(<<~"end;", { branches: true }, result)
|
||||||
@ -255,6 +257,10 @@ class TestCoverage < Test::Unit::TestCase
|
|||||||
until x == 10
|
until x == 10
|
||||||
x += 1
|
x += 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
y = 3
|
||||||
|
y -= 1 while y > 0
|
||||||
|
y += 1 until y == 10
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user