summaryrefslogtreecommitdiff
path: root/test/coverage/test_coverage.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-26 23:56:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-26 23:56:57 +0000
commitf540475134ea5aded740205631c0e9cea081c654 (patch)
tree370e82beffde532917781711cabb6c6a9c0b2426 /test/coverage/test_coverage.rb
parent06c57968707ba5a09e6347237fd289673269247b (diff)
Coverage on non-positive lines
* compile.c (ADD_TRACE): ignore trace instruction on non-positive line. * parse.y (coverage): get rid of ArgumentError when the starting line number is not positive. [ruby-core:76141] [Bug #12517] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/coverage/test_coverage.rb')
-rw-r--r--test/coverage/test_coverage.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/coverage/test_coverage.rb b/test/coverage/test_coverage.rb
index 8bc1104..0753ccd 100644
--- a/test/coverage/test_coverage.rb
+++ b/test/coverage/test_coverage.rb
@@ -110,4 +110,13 @@ class TestCoverage < Test::Unit::TestCase
ensure
$".replace loaded_features
end
+
+ def test_nonpositive_linenumber
+ bug12517 = '[ruby-core:76141] [Bug #12517]'
+ Coverage.start
+ assert_nothing_raised(ArgumentError, bug12517) do
+ RubyVM::InstructionSequence.compile(":ok", nil, "<compiled>", 0)
+ end
+ assert_include Coverage.result, "<compiled>"
+ end
end unless ENV['COVERAGE']