Skip to content
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

Additional error handling edge cases #356

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

obligaron
Copy link
Contributor

🤔 What's changed?

  • Added additional error handling edge cases as bad test data
  • [c] Optimise error handling for empty datatable rows
  • [Perl] Optimise error handling for unclosed DocStrings

⚡️ What's your motivation?

These error handling edge cases were reported to the .NET implementation and fixed in an upstream project in 2019. Later, these fixes were also merged into the gherkin repository.
While working on some optimisations (see #344), the question arose whether the regression tests should be ported to the gherkin repository. This ensures that all implementations can handle these edge cases that have been reported by users.

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, etc. without changing behaviour)
  • 🐛 Bug fix (non-breaking change which fixes a defect)

♻️ Anything particular you want feedback on?

The Perl implementation in general (first time writing Perl 😉), and also whether the required check for EOF should be added to other cases in the Perl implementation (but maybe this is something for another PR).

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

Copy link
Contributor

@mpkorstanje mpkorstanje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Small request for Perl. Do you think you can do that? If not, I can take a stab at it.

@@ -238,6 +238,9 @@ sub match_StepLine {

sub match_DocStringSeparator {
my ( $self, $token ) = @_;
if ($token->is_eof) {
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other implementations return true/false in _match_DocStringSeparator, which I think should cover this case.

To make it easier for everyone to compare across languages, it would be good to be consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an explicit false/0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants