Commit e260379
authored
fix: Reinstate support for legacy tag filters without
As reported by @carlos-granados in #406, the 4.16.0 release broke tag
filtering where the tag expression does not contain `@` symbols [e.g. in
Behat](https://github.com/Behat/Behat/actions/runs/20028377501/job/57431075976).
Behat's filter expression in the failing feature is arguably incorrect:
* It uses `new TagFilter('tag2')` (note no leading `@`) - the PHP config
object is obviously new but the value has been the same since [the
feature was first added in
2014](https://github.com/Behat/Behat/pull/434/files#diff-ca77b0b1e7860ced7eb08cc40f9d6648acc0760a0be45c5fd76a8a19992adbebR92)
* All the Behat documentation shows expressing tag filters with the
leading `@` e.g.
https://docs.behat.org/en/latest/user_guide/configuration/suites.html#suite-filters
* The actual implementation of tag filtering is done in Behat/Gherkin.
Gherkin's [TagFilterTest only tests tag expressions where the leading
`@` is
included](https://github.com/Behat/Gherkin/blame/297297343c125d058e18b3f03a24ebb32f70b69d/tests/Filter/TagFilterTest.php)
and that appears to have been the case from the beginning.
As far as I can see, `TagFilter` has therefore never been meant to
accept that expression, and it's been working by accident.
However, we obviously don't validate the expression, and we have
decided we should reintroduce support for it if even Behat
has been relying on it until now.
Note that this syntax is officially deprecated and will be removed in the
next major - see #408@ prefix (#407)1 parent 78e7755 commit e260379
File tree
3 files changed
+95
-1
lines changed- src/Filter
- tests/Filter
3 files changed
+95
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
10 | 18 | | |
11 | 19 | | |
12 | 20 | | |
| |||
588 | 596 | | |
589 | 597 | | |
590 | 598 | | |
| 599 | + | |
591 | 600 | | |
592 | 601 | | |
593 | 602 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
41 | 78 | | |
42 | 79 | | |
43 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
282 | 330 | | |
283 | 331 | | |
284 | 332 | | |
| |||
0 commit comments