Embed Notice
HTML Code
Corresponding Notice
- Embed this notice@lanodan @p @NonPlayableClown
> Well the yaml part of tap could be replaced with JSON fine.
Off hand YAML provides distinct separate messages with "\n---\n", but JSON has no such syntax. So if you send multiple tests' output in a stream you'd have to send them as elements of an array. Which means blocking until all the tests and their respective output are sent, rather than being able to immediately parse discrete chunks each time you encounter the message delimiter. So I think you'd still have to use YAML anyway, and default to JSON syntax for the data parts if that's your preference. Personally that's why I like it, because it's more flexible than JSON in certain situations. YMMV.
Apart from TAP, another cool feature of YAML is anchors/references so you don't have to repeat the same data when it's included in multiple records. In some use-cases that has significant advantages. Kinda like programming in Bash vs Perl. Really depends on the situation which is best.