Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • > To write tests for extremely hard-to-test code without mocking half of the known universe including the DBI -- this was the original reason.

    Holy crap, why didn't I know this exists.

    This is way way cool.

    I have some really evil testing cases that I've been to write for ages, but lacked a way to sanely inject stuff into the guts of code.

    Some questions though...

    The version dependency is current 5.008, is there any way it can go back to 5.005, or is it's use of internals just going to make 5.008 something t

    • Hey Alias,

      Re: 5.005, it *might* work, but I'm afraid to find out.

      As for examples, read through the t/* directory. They print stuff out on each line, so the output of the program reflects the post-modification state. If you can sort it out from reading and playing with those, send me some doc patches.

      I'd take your interest as plenty of motivation to go do some more (doubtlessly needed) work on the documentation, but I'm in middle of something else I need to hurry up and get done so I can go get some other stuff done that's overdue.

      Briefly, the algorithm for finding where to do the splice is to walk through the function in question until all of the pre-conditions have been met (they all matched somewhere). At that point, if any of the post-conditions have also matched, an error is thrown. The post-conditions are nothing more than sanity tests to make sure that the target code hasn't changed too much for the splice to be safe to apply.

      It depends on B::Generate and B::Deparse and bits of B::Deparse's internal API. It also depends on a formula for re-threading the bytecode that's probably just wishful thinking. The whole thing is highly experimental. For continued viability, that depends mostly on its dependencies, which I can't really make any guess about, other than I haven't heard discussion of axing either of those two modules.

      One last thing -- if you do get some tests written for hairy old code, get in touch. Perhaps we can collaborate on an article or something >=) That's assuming some time will open up...

      -scott