Acme-MetaSyntactic

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    - dilbert
    - pm_groups

0.59 2006-01-30 BOOK
    [NEW WEEKLY THEME 2006/01/30]
    - chess (Abigail)
    [ENHANCEMENTS]
    - Acme::MetaSyntactic::RemoteList now supports having several sources
      (but will parse them all in the same manner), thanks to Abigail
    [TESTS]
    - t/23length.t checks that items are not longer than 251 characters,
      and are therefore valid Perl identifiers
    [THEME UPDATES]
    - donmartin (Flavio Poletti noted that the list was incomplete.
      I put up a more accurate list instead of adding the missing item.)
    - haddock (Jan Pieter Cornet provided a Dutch version of the list)
    - pokemon (added two pokemons that the parsing code didn't catch)
    - tmnt (the lists sources are on the web)
    - yapc (some more YAPC were announced for 2006)

0.58 2006-01-22 BOOK

lib/Test/MetaSyntactic.pm  view on Meta::CPAN

    $tb->subtest(
        $theme,
        sub {
            $tb->subtest( "$theme fixme",    sub { subtest_fixme(@args); } );
            $tb->subtest( "$theme encoding", sub { subtest_encoding(@args); } );
            $tb->subtest( "$theme load",     sub { subtest_load(@args); } )
                or return;
            $tb->subtest( "$theme version",  sub { subtest_version(@args); } );
            $tb->subtest( "$theme data",     sub { subtest_data(@args); } );
            $tb->subtest( "$theme format",   sub { subtest_format(@args); } );
            $tb->subtest( "$theme length",   sub { subtest_length(@args); } );
            $tb->subtest( "$theme import",   sub { subtest_import(@args); } );
            $tb->subtest( "$theme noimport", sub { subtest_noimport(@args); } );
            $tb->subtest( "$theme theme",    sub { subtest_theme(@args); } );
            $tb->subtest( "$theme remote",   sub { subtest_remote(@args); } );
            $tb->done_testing;
        }
    );
}

#

lib/Test/MetaSyntactic.pm  view on Meta::CPAN

        my ( $ams, $theme ) = @$test;
        my @items = $ams->name(0);
        my @failed;
        my $ok = 0;
        ( /^[A-Za-z_]\w*$/ && ++$ok ) || push @failed, $_ for @items;
        $tb->is_num( $ok, scalar @items, "All names correct for $theme" );
        $tb->diag("Bad names: @failed") if @failed;
    }
}

# t/23length.t
sub subtest_length {
    my ($theme) = @_;
    my $tb = __PACKAGE__->builder;

    my @metas = _theme_sublists($theme);
    $tb->plan( tests => 2 * @metas );

    for my $t (@metas) {
        my ( $ams, $theme ) = @$t;

        # no empty themes
        my @items = $ams->name(0);
        $tb->cmp_ok( 0 + @items, '>=', 1, "$theme has at least one item" );

        # no empty names
        my @failed;
        my $ok = 0;
        ( length($_) >= 1 && length($_) <= 251 && ++$ok ) || push @failed, $_
            for @items;
        $tb->is_num( $ok, scalar @items, "All names correct for $theme" );
        $tb->diag("Names too long: @failed") if @failed;
    }
}

# t/24data.t
sub subtest_data {
    my ( $theme, $file ) = @_;
    $file = '' if !defined $file;

lib/Test/MetaSyntactic.pm  view on Meta::CPAN


=head2 subtest_version( $theme )

Checks that the theme has a C<$VERSION>.

=head2 subtest_format( $theme )

Checks that each metasyntactic name in the theme is a valid Perl
variable name.

=head2 subtest_length( $theme )

Checks that each name in the theme has valid length.

=head2 subtest_data( $theme, $source )

Checks that the C<__DATA__> section (if any) of the theme source is
properly formatted.

=head2 subtest_import( $theme )

Checks that the exported C<meta$theme> function returns an item from
C<$theme>.

script/meta  view on Meta::CPAN

  --sources         : return the sources (if any) of the remote list
EOT

my %conf = ( whitespace => 0, category => '' );
GetOptions( \%conf, "whitespace|ws!", "version", "themes", "help", "remote",
                    "check", "category=s", "sources" )
  or die $usage;

# find out the theme name
my $theme = shift || $Acme::MetaSyntactic::Theme;
if (!length $conf{category} && $theme =~ m{^([^/]+)/(.*)}s) {
    $theme          = $1;
    $conf{category} = $2;
}
die "Theme '$theme' does not exist!\n"
  . "Available themes: @{[ Acme::MetaSyntactic->themes ]}\n"
  unless Acme::MetaSyntactic->has_theme( $theme );

my $module = "Acme::MetaSyntactic::$theme";

# load the remote theme if needed

t/00-report-prereqs.t  view on Meta::CPAN


                if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) {
                    push @dep_errors, "$mod is not installed ($req_string)";
                }
            }
        }

        if ( @reports ) {
            push @full_reports, "=== $title ===\n\n";

            my $ml = _max( map { length $_->[0] } @reports );
            my $wl = _max( map { length $_->[1] } @reports );
            my $hl = _max( map { length $_->[2] } @reports );

            if ($type eq 'modules') {
                splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl];
                push @full_reports, map { sprintf("    %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports;
            }
            else {
                splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl];
                push @full_reports, map { sprintf("    %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports;
            }



( run in 0.263 second using v1.01-cache-2.11-cpan-65fba6d93b7 )