Commit f6d2ac2b authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch '35368-fix-gcovr-regexp-matching' into 'master'

Fix the gcovr coverage regex by removing line separators before scanning

Closes #35368

See merge request !13025
parents b5c3666f 000ddc96
......@@ -74,6 +74,7 @@ module Gitlab
match = ""
reverse_line do |line|
line.chomp!
matches = regex.scan(line)
next unless matches.is_a?(Array)
next if matches.empty?
......
......@@ -300,5 +300,12 @@ describe Gitlab::Ci::Trace::Stream do
include_examples 'malicious regexp'
end
context 'multi-line data with rooted regexp' do
let(:data) { "\n65%\n" }
let(:regex) { '^(\d+)\%$' }
it { is_expected.to eq('65') }
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment