Closed 3cp closed 4 years ago
Note, if plan line is after all result lines, tap-parser has no such issue.
The issue is that this is valid TAP:
TAP version 13
1..2
ok
ok
---
some: diagnostics
...
And so is this:
TAP version 13
1..2
ok
ok
---
some: diagnostics
...
{
1..1
ok - child assertion
}
And you can even put a comment right in the midst of all that jazz:
TAP version 13
1..2
ok
ok
---
some: diagnostics
...
# nested child test coming!
{
1..1
ok - child assertion
# here it is! it's happening!
}
So, it has to wait until it finds something that is definitely the end of the assertion. Since diagnostics might be coming after the assertion line, it has to wait for that. Since a buffered child test might be coming after the diagnostics, it has to wait for that too.
It works when the plan comes at the end, because 1..2
is definitely not diagnostics, not a comment, and not a buffered child test.
Sorry, I think you're going to just have to figure out a way to end the stream when it's done.
Thanks for the details!
A standard code copied from README, only added log on events "plan", "line" and "assert".
This is my
pp.js
If you cat a file to this program, it runs fine, but if you feed input from stdin line by line (manually by keyboard), you can see the "assert" strangely waits for stream end. I have this issue in my use case because my input stream never ends, and I need to use tap-parser "assert" event to understand TAP text.