The point of making it human-readable wasn't that it was going to be reviewed by a human at test time (in fact I am using test modules just as you suggest) it was simply to make it easier for me to review the original data in the event that the test fails, so I can more easily determine what went wrong.

True, the data is currently perfectly readable, but I would like to store it in the same file as the processed data that is associated with it to make it easier to manage by not having the data scattered across multiple files.

In essence, what I'm trying to do is something like this...

my $data = file( shift() )->slurp; ### At dev-time, when this processor is known to be working my $tst1 = MyApp::Processor->process( $data ); YAML::DumpFile( $file, $data, $test1 ); ### Then, sometime later in a test script... my @files = <test-files/*.yml>; plan tests => scalar @files; for my $file ( @tests ) { my ( $data, $test1 ) = YAML::LoadFile( $file ); my $test2 = MyApp::Processor->process( $data ); eq_or_diff( $test1, $test2, "$file not broken yet!" ); }

www.jasonkohles.com
We're not surrounded, we're in a target-rich environment!

In reply to Re^2: Human-readable serialization formats other than YAML? by jasonk
in thread Human-readable serialization formats other than YAML? by jasonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.