I think that part of testing code is trying to understand it and then giving it more cases. In order for me to see what is happening here, I had to add a routine to print the array as we are accustomed to seeing 2d arrays. I had to add a bunch of say statements to suss out the internals. I got my first look at is_deeply, where the 3rd argument $test_name must be optional:
is_deeply
is_deeply( $got, $expected, $test_name );
I'm also new with the syntax involving alias, so I printed out values to form a question there. I added a test to substitute in an 'M', intentionally causing the ultimate test to fail, to see if it would. I'll list output and then source between readmore tags:
Q1) What is the purpose of using alias in this line
alias my $r = $$range[$i];
when it goes out of scope at the end of the loop?
I always enjoy reading your posts, haukex, finding them challenging in the right way. I hope you don't resent me "embellishing" on your script.
|