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:
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 a Test field. There was no functionality yet to encode such a condition, so this PR adds a precondition function to the stateChange 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?
Please describe the change you are making
Lines starting with
?
are interpreted as a package being skipped:https://github.com/GoTestTools/gotestfmt/blob/4c97682ab858d6bbd26fc020e255cb339c9c8119/tokenizer/tokenizer.go#L183-L188
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