Test::Aggregate::Nested

Currently I'm trying to convert our work test suite over to Test::Aggregate::Nested. This is an alternative to Test::Aggregate which is much cleaner internally and relies on nested TAP, available in the latest versions of the Test::Simple distribution. Using it is pretty simple:

use Test::Aggregate::Nested;

my $tests = Test::Aggregate::Nested->new( {
    dirs => $aggregate_test_dir,
} );
$tests->run;

There are a few more features I need to hack in, but two nice advantages this provides are:

  1. The restriction on __END__ and __DATA__ tokens goes away.
  2. "Variable will not stay shared" warnings go away.

Regrettably, it turns out that I've introduced a regression in Test::Aggregate itself. Apparently, "no_plan" tests don't work correctly, but this may be the nasty hacks to the Perl internals which Test::Aggregate relies upon. Fortunately, the nested version minimizes those hacks quite a bit.

In praise of Try::Tiny

Try::Tiny is one of those tools that feels like it should always be in your toolbox. Handling exceptions in Perl is awkward; Java, JavaScript, Python, and Objective-C all provide native try syntax. Perl does, mostly, via eval {} blocks, but it's hinky. Errors coming out of the block aren't local by default, and it's almost a dozen lines of boilerplate to add it properly.

Enter Try::Tiny:

A Blog Post

Introducing blogs.perl.org . I'm so happy!

So close, so close ...

It appears that, at long last, we'll get a proper blogging platform! With syntax highlighting:

    sub add_to_list {
        my ( $self, $text ) = @_;
        return unless defined $text;
        $text = $self->interpolate($text);

        # This horror of horrors is because we want simple lists to be single
        # spaced, unless there are further details after the =item line, in which
        # case an extra newline is needed for pleasant formatting.
        my $break = '';
        if ( $self->list_data =~ /\n.ITEM\n.*\n$/ && $text !~ /^.ITEM/ ) {
            $break = "\n";
        }
        $self->list_data( $self->list_data . "$break$text" );
    }

And we even have images! (Not that they're helping this post look any better.

And if you look down below, you even see tags :)

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.