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.
  • This sounds very similar to Test::Inline [cpan.org]. How does Test::Pod::Snippets compare?

    • It's very similar indeed. The big difference is that T::P::S extracts the code to test directly from the pod, whereas with T::I you have to explicitly add the test code. In other words, T::I don't do any dark voodoo magic with the pod, it just deal with files that contains code, pod and tests.

      For example, with T::I you'd have to write:

      =head2 Foo

      That's how you do it:

        # will set $x to 'baz'
        my $x = bar( $y );

      =begin testing
      my $x = bar( $y );
      is $x => 'baz';
      =end tes

      • Ah -- I didn't get that part.

        As a result, you've got the opposite problem from Test::Inline -- you have to specially flag verbatim code that isn't related to testing. (E.g. synopses and random examples).

        Some say pota-TOE and some say po-TAH-to...

        I think it's worth highlighting that difference to Test::Inline in a SEE ALSO section.

        I also don't particularly like the way you're using =for test ignore followed by a blank line as parser flag. In my opinion, that meets the letter of the Pod syntax but violates the spirit. (Not that I see any other way for you to do it while meeting your design goal.)

        • As a result, you've got the opposite problem from Test::Inline -- you have to specially flag verbatim code that isn't related to testing. (E.g. synopses and random examples).

          Actually, it's mostly the synopses and the random examples that I am interested to run. They just tend to be stuff that you write directly in the docs and never get around testing, or just get out of sync with the code as time passes by.

          And yeah, seen like that, T::P::S is a wee bit like the alter-ego of T::I from the Alternate Univ