Behat / Gherkin

Gherkin parser, written in PHP for Behat project
MIT License
1.05k stars 89 forks source link

Support alternative docstrings format (```) #214

Closed ciaranmcnulty closed 3 years ago

ciaranmcnulty commented 3 years ago

Closes #155

ciaranmcnulty commented 3 years ago

I can't particularly see a test to add aside from adding some fixtures (which would be duplicating the cucumber test)

stof commented 3 years ago

if the cucumber tests cover that already, that's already enough to cover it IMO

ciaranmcnulty commented 3 years ago

I definitely felt the need for more lower-level tests here. Perhaps the various Protected methods inside the Lexer could be promoted into objects and tested more thoroughly?

For instance the meat of scanPyStringOp could be tested fairly comprehensively

stof commented 3 years ago

I don't think these methods should be promoted (I don't even think they should be protected btw). That would couple tests to the exact implementation of the parsing. To me, this should be covered by feeding more valid and invalid inputs to the parser instead (which would then outlive any refactoring of the parsing implementation). And such inputs should ideally be contributed upstream rather than be kept in our repo (if they are not there already) so that official gherkin parsers also benefit from these tests (and we are sure that we have the same behavior).

ciaranmcnulty commented 3 years ago

Cool. Contributing to the upstream tests is slightly harder than it could be, but the documentation has recently improved so I'll be adding some in