I can see why we wouldn't want to include YAML, and won't cry for *too
long* if it doesn't go in ;), but here are some reasons why I'd like for
full YAML to be a part of the spec:

- marshaling data structures between the application being tested and
the test harness (strings are nice, but full Perl/!!YAML objects are nicer)

- infinite extensibility (then again, it was a little bit too easy for
people to add <proprietarytag> to HTML, and look at what that got us)

I just think having all of YAML at our disposal would let test authors
and test harness authors do pretty much anything they want.

YAML is pretty hard to parse, but fortunately the Hard Work has been
done for us.  YAML::Syck supports all the YAML we need and it has
bindings for pretty much every language.  I wouldn't call it
lightweight, but the 300k of additional memory it uses is worth the
potential benefits.

I dunno, maybe I *am* overthinking this.  It's just TAP.  I guess what I
really want is for the perl interpreter to be able to serialize itself
so I can debug failing tests more easily.  That's not really a TAP
issue,though :)

Regards,
Jonathan Rockway


Adam Kennedy wrote:
> Whoa whoa whoa slow down there folks...
> 
> Some people seemed to have misrecognised those keys as YAML.
> 
> It was NEVER meant to be YAML.
> 
> The idea was to use something more like MIME headers.
> 
> We all agreed that we DIDN'T want the format to be too heavy, and going
> with MIME or MIME-alike seemed the sweet spot in terms of ease of
> parsing and standardization vs extensibility.
> 
> Having YAML in the TAP spec would complicate things greatly, especially
> as the YAML spec includes things like multi-line strings. And it would
> mean that we'd have to deal with YAML error events, JSON-style parsing
> and a bunch of other things that are problematic.
> 
> It's NOT ease to parse at all, not compared to the current relative
> simplicity of TAP at the moment.
> 
> Adam K
> 
> Jonathan T. Rockway wrote:
>>>  not ok 2 - omg t3h sooper test!!1!
>>>  --- TAP diagnostics
>>>  file:        foo.t
>>
>>
>> Why aren't we commenting the YAML block so that it's compatible with
>> current TAP parsers?  I'm thinking something like this:
>>
>> not ok 2 - ensure that foo is equal to bar
>> # --- !!tap/diagnostics
>> # file: foo.t
>> # line: 42
>> # got:
>> #      - !!perl/foobar
>> #          key: value
>> # expected:
>> #      - !!perl/foobar
>> #         key: ~
>> # etc: (and so on)
>>
>> The commented section is raw YAML goodness, AND this format is
>> compatible with current TAP parsers.  I'm liking this a lot,
>> especially since I can use it Right Now (tm) by doing diag(Dump($data)).
>>
>> Any reason this shouldn't be the standard? It's easy to parse, it's
>> easy to read.
>>
>> Would it be acecptable if I patched Test::More to start outputing it's
>> expected/got messages in YAML instead of a plain text format?
>>
>> Regards,
>> Jonathan Rockway
> 


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to