-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #13345: Enable examples tests for RegexpMultilineCheck
- Loading branch information
1 parent
7868e65
commit d961385
Showing
13 changed files
with
407 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...les/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/Example1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/*xml | ||
<module name="Checker"> | ||
<module name="RegexpMultiline"/> | ||
</module> | ||
*/ | ||
package com.puppycrawl.tools.checkstyle.checks.regexp.regexpmultiline; | ||
|
||
// xdoc section -- start | ||
class Example1 { | ||
void testMethod1() { | ||
|
||
System.out.print("Example"); | ||
|
||
System.err.println("Example"); | ||
System | ||
.out.print("Example"); | ||
System | ||
.err.println("Example"); | ||
System. | ||
out.print("Example"); | ||
System. | ||
err.println("Example"); | ||
} | ||
|
||
void testMethod2() { | ||
|
||
System.out.println("Test #1: this is a test string"); | ||
|
||
System.out.println("TeSt #2: This is a test string"); | ||
|
||
System.out.println("TEST #3: This is a test string"); | ||
int i = 5; | ||
|
||
System.out.println("Value of i: " + i); | ||
|
||
System.out.println("Test #4: This is a test string"); | ||
|
||
System.out.println("TEst #5: This is a test string"); | ||
} | ||
} | ||
// xdoc section -- end |
12 changes: 0 additions & 12 deletions
12
...ples/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/Example1.txt
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
...les/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/Example2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/*xml | ||
<module name="Checker"> | ||
<module name="RegexpMultiline"> | ||
<property name="format" value="System\.(out)|(err)\.print(ln)?\("/> | ||
</module> | ||
</module> | ||
*/ | ||
package com.puppycrawl.tools.checkstyle.checks.regexp.regexpmultiline; | ||
|
||
// xdoc section -- start | ||
class Example2 { | ||
void testMethod1() { | ||
// violation below, 'Line matches the illegal pattern' | ||
System.out.print("Example"); | ||
// violation below, 'Line matches the illegal pattern' | ||
System.err.println("Example"); | ||
System | ||
.out.print("Example"); | ||
System | ||
.err.println("Example"); // violation, 'Line matches the illegal pattern' | ||
System. | ||
out.print("Example"); | ||
System. | ||
err.println("Example"); // violation, 'Line matches the illegal pattern' | ||
} | ||
|
||
void testMethod2() { | ||
// violation below, 'Line matches the illegal pattern' | ||
System.out.println("Test #1: this is a test string"); | ||
// violation below, 'Line matches the illegal pattern' | ||
System.out.println("TeSt #2: This is a test string"); | ||
// violation below, 'Line matches the illegal pattern' | ||
System.out.println("TEST #3: This is a test string"); | ||
int i = 5; | ||
// violation below, 'Line matches the illegal pattern' | ||
System.out.println("Value of i: " + i); | ||
// violation below, 'Line matches the illegal pattern' | ||
System.out.println("Test #4: This is a test string"); | ||
// violation below, 'Line matches the illegal pattern' | ||
System.out.println("TEst #5: This is a test string"); | ||
} | ||
} | ||
// xdoc section -- end |
26 changes: 0 additions & 26 deletions
26
...ples/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/Example2.txt
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
...les/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/Example3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/*xml | ||
<module name="Checker"> | ||
<module name="RegexpMultiline"> | ||
<property name="matchAcrossLines" value="true"/> | ||
<property name="format" value="System\.out.*?print\("/> | ||
</module> | ||
</module> | ||
*/ | ||
package com.puppycrawl.tools.checkstyle.checks.regexp.regexpmultiline; | ||
|
||
// xdoc section -- start | ||
class Example3 { | ||
void testMethod1() { | ||
// violation below, 'Line matches the illegal pattern' | ||
System.out.print("Example"); | ||
|
||
System.err.println("Example"); | ||
System | ||
.out.print("Example"); | ||
System | ||
.err.println("Example"); | ||
System. | ||
out.print("Example"); | ||
System. | ||
err.println("Example"); | ||
} | ||
|
||
void testMethod2() { | ||
|
||
System.out.println("Test #1: this is a test string"); | ||
|
||
System.out.println("TeSt #2: This is a test string"); | ||
|
||
System.out.println("TEST #3: This is a test string"); | ||
int i = 5; | ||
|
||
System.out.println("Value of i: " + i); | ||
|
||
System.out.println("Test #4: This is a test string"); | ||
|
||
System.out.println("TEst #5: This is a test string"); | ||
} | ||
} | ||
// xdoc section -- end |
27 changes: 0 additions & 27 deletions
27
...ples/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/Example3.txt
This file was deleted.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
...les/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/Example4.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/*xml | ||
<module name="Checker"> | ||
<module name="RegexpMultiline"> | ||
<property name="format" value="Test #[0-9]+:[A-Za-z ]+"/> | ||
<property name="ignoreCase" value="true"/> | ||
<property name="maximum" value="3"/> | ||
</module> | ||
</module> | ||
*/ | ||
package com.puppycrawl.tools.checkstyle.checks.regexp.regexpmultiline; | ||
|
||
// xdoc section -- start | ||
class Example4 { | ||
void testMethod1() { | ||
|
||
System.out.print("Example"); | ||
|
||
System.err.println("Example"); | ||
System | ||
.out.print("Example"); | ||
System | ||
.err.println("Example"); | ||
System. | ||
out.print("Example"); | ||
System. | ||
err.println("Example"); | ||
} | ||
|
||
void testMethod2() { | ||
|
||
System.out.println("Test #1: this is a test string"); | ||
|
||
System.out.println("TeSt #2: This is a test string"); | ||
|
||
System.out.println("TEST #3: This is a test string"); | ||
int i = 5; | ||
|
||
System.out.println("Value of i: " + i); | ||
// violation below, 'Line matches the illegal pattern' | ||
System.out.println("Test #4: This is a test string"); | ||
// violation below, 'Line matches the illegal pattern' | ||
System.out.println("TEst #5: This is a test string"); | ||
} | ||
} | ||
// xdoc section -- end |
21 changes: 0 additions & 21 deletions
21
...ples/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/Example4.txt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.