andreasgal/vtt.js — pull request #8 by humphd (2013-07-11 20:16:23+00:00)
Title: Restructure tests

What do you think about a layout like this. Each .vtt file has a .js file with the same name. It uses the common `util` harness module, and can do various things:

* Use the WebVTTParser object directly -- `util.WebVTTParser`
* Get access to the TAP/assertion objects -- `util.test`
* Run a set of assertions on a parsed VTT file, reading the whole file in one shot -- `util.parseWholeTest(filename, assertionFunc)`
* Run a set of assertions on a parsed VTT file, reading the file in chunks (streaming) -- `util.parseStreamingTest(filename, assertionFunc)`
* Do both of the above in order -- `util.parseTest(filename, assertionFunc)`

The only down side here is how noisy it is to run tests, since you end up running your assertions a lot. Having said that, you get better coverage across different chunk sizes (I'm currently failing 4 of 205 assertions in simple.js, which might be my harness code, or might be a parser bug?).

Let me know how people want to work, and I'll modify things accordingly. Do we care about supporting parallel jsshell runs? I don't, but you might disagree.