|
1 | 1 | package io.jenkins.plugins.analysis.warnings.groovy;
|
2 | 2 |
|
3 |
| -import java.io.IOException; |
4 |
| -import java.io.StringReader; |
5 |
| - |
6 | 3 | import org.apache.commons.lang3.StringUtils;
|
7 | 4 | import org.junit.jupiter.api.Test;
|
| 5 | +import org.junit.jupiter.params.ParameterizedTest; |
| 6 | +import org.junit.jupiter.params.provider.ValueSource; |
8 | 7 | import org.junitpioneer.jupiter.Issue;
|
9 | 8 |
|
10 | 9 | import edu.hm.hafner.analysis.IssueParser;
|
11 | 10 | import edu.hm.hafner.analysis.Report;
|
12 | 11 | import edu.hm.hafner.util.SerializableTest;
|
13 | 12 |
|
| 13 | +import java.io.IOException; |
| 14 | +import java.io.StringReader; |
| 15 | + |
14 | 16 | import hudson.model.Run;
|
15 | 17 |
|
16 | 18 | import io.jenkins.plugins.analysis.core.util.ConsoleLogReaderFactory;
|
@@ -57,13 +59,11 @@ void shouldShortenExample() {
|
57 | 59 | *
|
58 | 60 | * @see <a href="https://issues.jenkins-ci.org/browse/JENKINS-35262">Issue 35262</a>
|
59 | 61 | */
|
60 |
| - @Test |
61 |
| - void issue35262() throws IOException { |
62 |
| - matchMultiLine("(make(?:(?!make)[\\s\\S])*?make-error:.*(?:\\n|\\r\\n?))"); |
63 |
| - matchMultiLine("(make(?:(?!make)[\\s\\S])*?make-error:.*(?:\\r?))"); |
64 |
| - } |
65 |
| - |
66 |
| - private void matchMultiLine(final String multiLineRegexp) throws IOException { |
| 62 | + @Issue("JENKINS-35262") |
| 63 | + @ParameterizedTest(name = "{index}: Regular expression should be multiline \"{0}\"") |
| 64 | + @ValueSource(strings = {"\\n|\\r\\n", "\\r", "\\R"}) |
| 65 | + void issue35262(final String regexp) throws IOException { |
| 66 | + var multiLineRegexp = String.format("(make(?:(?!make)[\\s\\S])*?make-error:.*(?:%s?))", regexp); |
67 | 67 | String textToMatch = toString("issue35262.log");
|
68 | 68 | String script = toString("issue35262.groovy");
|
69 | 69 |
|
|
0 commit comments