Commit 06311c6
authored
Fix test filter greediness for method names (#93)
The present change aims at preventing the `MyTest#testSomething` pattern
from matching the `testSomethingElse` method in the following example:
```java
public class MyTest {
@test
void testSomething() {
}
@test
void testSomethingElse() {
}
```
With `asPredicate`, the test filter matches test methods _starting with_
the given method name:
> Creates a predicate that tests if this pattern is found in a given
> input string.
Unless the pattern doesn't encompass a method name, appending a `$` to
the input pattern makes sure only exact method names are considered.
Note: think about filter greediness for class names.1 parent d315d8f commit 06311c6
File tree
2 files changed
+39
-7
lines changed- java
- src/com/github/bazel_contrib/contrib_rules_jvm/junit5
- test/com/github/bazel_contrib/contrib_rules_jvm/junit5
2 files changed
+39
-7
lines changedLines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
62 | 73 | | |
63 | 74 | | |
64 | 75 | | |
65 | | - | |
| 76 | + | |
66 | 77 | | |
67 | 78 | | |
68 | 79 | | |
| |||
76 | 87 | | |
77 | 88 | | |
78 | 89 | | |
79 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
80 | 98 | | |
81 | 99 | | |
Lines changed: 19 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
190 | 204 | | |
191 | 205 | | |
192 | 206 | | |
193 | | - | |
| 207 | + | |
194 | 208 | | |
195 | 209 | | |
196 | 210 | | |
| |||
0 commit comments