summaryrefslogtreecommitdiff
path: root/test/coverage/test_coverage.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-01 01:47:14 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-01 01:47:14 +0000
commit4130969ea19835d0a69a69ee6ffc7fa3dfedb675 (patch)
tree2a25320ec10245b480db9af9766e4a97c8acc92d /test/coverage/test_coverage.rb
parent04dec2df733a7ca1cf895be3e82ad3b0cf374741 (diff)
Revert r66670 because of wrong ticket number
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/coverage/test_coverage.rb')
-rw-r--r--test/coverage/test_coverage.rb17
1 files changed, 5 insertions, 12 deletions
diff --git a/test/coverage/test_coverage.rb b/test/coverage/test_coverage.rb
index 1797c89..d2a2d01 100644
--- a/test/coverage/test_coverage.rb
+++ b/test/coverage/test_coverage.rb
@@ -348,22 +348,15 @@ class TestCoverage < Test::Unit::TestCase
def test_branch_coverage_for_safe_method_invocation
result = {
:branches=>{
- [:"&.", 0, 6, 0, 6, 6] => {[:then, 1, 6, 0, 6, 6]=>1, [:else, 2, 6, 0, 6, 6]=>0},
- [:"&.", 3, 7, 0, 7, 6] => {[:then, 4, 7, 0, 7, 6]=>0, [:else, 5, 7, 0, 7, 6]=>1},
- [:"&.", 6, 8, 0, 8, 10] => {[:then, 7, 8, 0, 8, 10]=>1, [:else, 8, 8, 0, 8, 10]=>0},
- [:"&.", 9, 9, 0, 9, 10] => {[:then, 10, 9, 0, 9, 10]=>0, [:else, 11, 9, 0, 9, 10]=>1},
+ [:"&.", 0, 3, 0, 3, 6] => {[:then, 1, 3, 0, 3, 6]=>1, [:else, 2, 3, 0, 3, 6]=>0},
+ [:"&.", 3, 4, 0, 4, 6] => {[:then, 4, 4, 0, 4, 6]=>0, [:else, 5, 4, 0, 4, 6]=>1},
}
}
assert_coverage(<<~"end;", { branches: true }, result)
- class Dummy; def foo; end; def foo=(x); end; end
- a = Dummy.new
+ a = 10
b = nil
- c = Dummy.new
- d = nil
- a&.foo
- b&.foo
- c&.foo = 1
- d&.foo = 1
+ a&.abs
+ b&.hoo
end;
end