Ian Langworth wrote:

I mentioned YAML with a pretense I failed to mention -- that we
wouldn't parse the YAML. That's already been done, and there are
plenty of parsers.


I agree with this. YAML has been done and done again, in every language. It works, it's tested. I don't think we need EVERY feature of YAML; Syck is enough for my everyday use, anyway.

How about this? Let's make "comments" and "data" separate parts of TAP. Comments are the usual

# Testing Foo::Bar 0.42 on perl 6.0.0 (r69342 20091225)

We already have and use these, so no further explanantion is necessary :) In addition to comments, we could have some "data" that follows a test. A data section begins with "--- " and ends with "...", and can contain anything. This is an "approved" way of getting data from the app to the harness if necessary. If the harness doesn't understand whatever's in that section, it can safely ignore it. If the harness DOES understand the data, well then, it can act on it. This seems like the best way to make everyone happy :)

However, if you wanted to make *me* happy ;), why not make the whole darn thing a YAML stream like this:

---
plan: 10
testname: foo
---
diagnostic: Testing Foo::Bar version 42
interperter: perl 6.0.0 (20091225)
operating_system: OpenBSD
other: information
---
test: Test whether foo + bar = baz
result: ok
sequence: 1
---
test: Test whether foo - bar = bar
result: not ok
sequence: 2
have: !!perl:hash/Foo::Bar
        hello: world
        value: 32
want: !!perl:hash/Foo::Bar
        hello: world
        value: 38
filename: t/foo.t
line: 8
---
etc.

The harness can then print out:

foo.........0/10
foo.........1/10
foo.........2/10
FAILED TEST 2:
have: [whatever Foo::Bar stringifies to]
want: [whatever the other Foo::Bar stringifies to]

as per usual.

IO::YAML will handle these streams properly, BTW. This might be a Perl-only solution, though.

Regards,
Jonathan Rockway

Reply via email to