Perl unit testing deep structures -


tmtowtdi, sure hope - i've been using test::deep last few projects whenever come across multidimensional hashes (sometimes 4-5 levels deep). right usual practice typing out these hashes , filling in expected data running cmp_deeply(actual, expected, msg). have advice on unit testing deep nested data this? - current method seems grossly inefficient, taking on hour per unit test of data structure.

i'm using test::more , is_deeply next commenter. have automated comparison having t/sample/ directory in store expected values running tests hand , using data::dumper appropriate. (oh i'd better have gone yaml -- tmtowtdi!)

i.e. run dump-generator once, review dumped structures, commit them, , rely on is_deeply until tests break means either bug, or intended structure change.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -