----- Original Message ---- > From: Gabor Szabo <szab...@gmail.com> > > I am quite confused and I am not sure what do I really want :-) > > I recall that we talked about a possibility to emit yamlish but the last thing > I remember was the discussion about lower or upper case names... > Was there a progress in that subject ? > > > Anyway here is another thing that I found. > The test script fetches a few rows from a database and prints out a > nicely formatted > table of the values using high quality ascii art: > > 1 | 3 | foo > 1 | 7 | bar > > I can just print the array holding this using explain \...@data but that > will lead to > an uprising.
It will also likely lead to misinterpreted test results :) Explain sends its data to the diagnostic file handle. That's usually STDERR and is not guaranteed to be in synch with STDOUT. Thus, the extra information printed is not guaranteed to go with the test lines you think it does. > The people who need to see this are Java and Matlab programmers. > Any other YAML like output will still be inferior to that nicely > formatted table but I hope > I'll be able to hook up some formater to display that nicely. > Preferably inside Smolder > as that's what we are going to use to collect the reports. This is exactly the sort of use case envisioned for TAP diagnostics. First, the diagnostics go to STDOUT instead of STDERR, guaranteeing that they are synched corrrectly. Second, user-supplied diagnostics *are* parsed by TAP::Parser (see TAP::Parser::Result::YAML) and instead of you getting a chunk 'o text, it's converted to the appropriate Perl data structure (though you can get the raw text if you wanted). You would just set your string as the value of a key and it would magically work. So hypothetically, you could do this: while ( my $result = $parser->next ) { if ( $result->is_yaml ) { display($result->data->{ascii_art}); } } Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog - http://use.perl.org/~Ovid/journal/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6