in reply to Re^6: Writing tests when you don't know what the output should be
in thread Writing tests when you don't know what the output should be

It depends on what you want. My solution expects the user only wants to supply the directory name and doesn't care about the internal implementation. It locks in a dependency, though, so another approach would be to accept just an object with a defined interface (dependency injection) - it's easier to test and extend.

You should start with a picture, define the behaviours of the objects, and the implementation should emerge from the design, not vice versa.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,