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!" ); }
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |