-
Notifications
You must be signed in to change notification settings - Fork 1
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
Issue-14: replace outline variables in docstrings #16
Conversation
I will be going over the 'multiple examples' problem separately (assuming that I am correct that it is an actual problem). |
var called bool | ||
steps.Given("something is:", func(_ []string, step StepNode) { | ||
called = true | ||
assert.Equal(t, "minimally functional\n\n", step.PyString().String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two newlines is incorrect. If one comes from the initial parsing1, I'm fine with leaving it. Adding any is definitely not good.
1 Gherkin tests show the final newline being omitted, but that should be done over in go-gherkin, I think.
- https://github.com/cucumber/gherkin3/blob/master/testdata/good/docstrings.feature.ast#L12-L16
- https://github.com/cucumber/gherkin3/blob/master/testdata/good/docstrings.feature.ast.json#L38
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has to do with how go-gherkin prints out the lines via the String()
function: https://github.com/muhqu/go-gherkin/blob/e07b6f9917cc9d90dd0a5d5f9ab9a63c82efe045/nodes/nodes.go#L463-L469
In reality what is stored in with the single \n. It's only when we print it in the test that is shows up with two \n's.
I'm at a bit of a loss. It seems like when we execute the step we will have the correct single \n character. I could resolve this like so:
pyString.AddLine(replace(strings.Trim(original.PyString().String(), "\n")))
But wouldn't I be removing the newline that will be present in the steps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't realize that PyStringNode
stored separate lines. We need to keep doing that, so I guess iterate Lines()
and AddLine(replace(line))
many times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the assertion should change to Lines()
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 835b954
Failing build! Whattttttt |
Oh, just a temporary connection issue. |
👍 |
Issue-14: replace outline variables in docstrings
No description provided.