Skip to content
Snippets Groups Projects
Commit f6d2ac2b authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

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
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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?
Loading
Loading
Loading
Loading
@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment