mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 21:49:06 +02:00
Introduce NODE_UNLESS for branch coverage
`unless` statement was a syntactic sugar for `if` statement, which made the result of branch coverage hard to understand. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
78cf46078e
commit
3c8c17d30d
5 changed files with 43 additions and 10 deletions
|
@ -186,13 +186,19 @@ class TestCoverage < Test::Unit::TestCase
|
|||
f.puts ' else'
|
||||
f.puts ' 1'
|
||||
f.puts ' end'
|
||||
f.puts ''
|
||||
f.puts ' unless x == 0'
|
||||
f.puts ' 0'
|
||||
f.puts ' else'
|
||||
f.puts ' 1'
|
||||
f.puts ' end'
|
||||
f.puts 'end'
|
||||
f.puts 'foo(0)'
|
||||
f.puts 'foo(0)'
|
||||
f.puts 'foo(1)'
|
||||
end
|
||||
|
||||
assert_in_out_err(%w[-W0 -rcoverage], <<-"end;", ["{:branches=>{[:if, 0, 2]=>{[:then, 1, 3]=>2, [:else, 2, 5]=>1}}}"], [])
|
||||
assert_in_out_err(%w[-W0 -rcoverage], <<-"end;", ["{:branches=>{[:if, 0, 2]=>{[:then, 1, 3]=>2, [:else, 2, 5]=>1}, [:unless, 3, 8]=>{[:else, 4, 11]=>2, [:then, 5, 9]=>1}}}"], [])
|
||||
ENV["COVERAGE_EXPERIMENTAL_MODE"] = "true"
|
||||
Coverage.start(branches: true)
|
||||
tmp = Dir.pwd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue