Fix lines starting with ? being incorrectly interpreted #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please describe the change you are making
Lines starting with
?
are interpreted as a package being skipped:gotestfmt/tokenizer/tokenizer.go
Lines 183 to 188 in 4c97682
If a test prints a line that matches this pattern, then that output is incorrectly interpreted as a test being skipped and is therefore printed like this instead of hiding it (yes, the test does actually print a lot of question marks):
Looking at the JSON output produced by
go test
for packages being skipped:and the JSON output of a test that prints a line starting with
?
:we see that we can distinguish between these two cases on the basis of the
Test
field.So this PR only interprets lines starting with
?
as a package being skipped when it's not output from a test, i.e. its JSON line doesn't have aTest
field. There was no functionality yet to encode such a condition, so this PR adds aprecondition
function to thestateChange
struct.Your code will be released under the Unlicense into the public domain for everyone to use for any purpose. Are you in the position, and are you willing to release your code under this license?
yes