-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JVM] Pretty Formatter error #619
Comments
What cucumber-jvm version? |
Sorry, I forgot to add that info. Note: we don't use any dependency management tool, I've added those by hand... java: 1.7 I don't know if you need these, but here goes: Thanks! |
I've updated the issue with some more info. I've added two scenarios, and I've noticed the following:
This lead me to believe it is related to the regular expressions I used (updated in my first post). |
The problem lies in:
Nested capture groups cannot be handled by the PrettyFormatter. Since each capture groups maps to an argument, this sort of gives an argument in an argument, the third argument ( |
@mlvandijk if you want to try this one you can start by trying to reproduce the issue. It might not be possible to reproduce the problem in If it is possible to reproduce the issue you can add a unit test to PrettyFormatter. Because this is a nested capture group I think it will be okay do boundary checking and do nothing if the index is out of bounds. |
@mpkorstanje Sure, will give it a try. Thanks! |
@mpkorstanje @brasmusson I've reproduced this issue, (added a test for it) and made some small changes to PrettyFormatter to prevent StringIndexOutOfBoundsException from being thrown for nested arguments. This does not break any other tests in Core. However, I am not sure if this is how PrettyFormatter should work. |
Fixed by PR #1200 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi,
I am getting a StringIndexOutOfBoundsException when using the pretty formatter. When I remove the formatter, all my scenarios pass.
UPDATE:
it seems this problem has to do with the regular expressions I use for my feature steps.
I have the following feature file, in portuguese (UPDATED):
I am using these regular expressions for my step defs:
Here's the full stack trace:
When I remove the pretty formatter, all my scenarios pass.
The text was updated successfully, but these errors were encountered: