Skip to content

Commit

Permalink
bring in the tests from t/18import.t
Browse files Browse the repository at this point in the history
  • Loading branch information
book committed Mar 31, 2012
1 parent cce0d98 commit d40bc65
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
37 changes: 29 additions & 8 deletions lib/Test/MetaSyntactic.pm
Expand Up @@ -30,13 +30,14 @@ sub theme_ok {
$tb->subtest(
$theme,
sub {
$tb->subtest( "load $theme", sub { subtest_load(@args); } );
$tb->subtest( "format $theme", sub { subtest_format(@args); } );
$tb->subtest( "uniq $theme", sub { subtest_uniq(@args); } );
$tb->subtest( "length $theme", sub { subtest_length(@args); } );
$tb->subtest( "data $theme", sub { subtest_data(@args); } );
$tb->subtest( "import $theme", sub { subtest_import(@args); } );
$tb->subtest( "theme $theme", sub { subtest_theme(@args); } );
$tb->subtest( "load $theme", sub { subtest_load(@args); } );
$tb->subtest( "format $theme", sub { subtest_format(@args); } );
$tb->subtest( "uniq $theme", sub { subtest_uniq(@args); } );
$tb->subtest( "length $theme", sub { subtest_length(@args); } );
$tb->subtest( "data $theme", sub { subtest_data(@args); } );
$tb->subtest( "import $theme", sub { subtest_import(@args); } );
$tb->subtest( "noimport $theme", sub { subtest_noimport(@args); } );
$tb->subtest( "theme $theme", sub { subtest_theme(@args); } );
$tb->done_testing;
}
);
Expand Down Expand Up @@ -155,6 +156,20 @@ sub subtest_import {
}
}

# t/18import.t
sub subtest_noimport {
my ($theme) = @_;
my $tb = __PACKAGE__->builder;
$tb->plan( tests => 1 );

eval "package Test::MetaSyntactic::EMPTY; use Acme::MetaSyntactic::$theme (); 1;"
or __PACKAGE__->builder->diag("$theme $@");

# meta$theme should not exist
eval "package Test::MetaSyntatic::EMPTY; meta$theme(1);";
$tb->ok( $@ =~ /^Undefined subroutine &Test::MetaSyntatic::EMPTY::meta$theme called/, "meta$theme function not exported" );
}

# t/21format.t
sub subtest_format {
my ($theme) = @_;
Expand Down Expand Up @@ -312,7 +327,13 @@ properly formatted.
=head2 subtest_import( $theme )
Checks that the exported C<meta$theme> function returns an item from C<$theme>.
Checks that the exported C<meta$theme> function returns an item from
C<$theme>.
=head2 subtest_noimport( $theme )
Checks that C<use Acme::MetaSyntactic::I<$theme> ()> does not export
the C<meta$theme> function.
=head2 subtest_theme( $theme )
Expand Down
19 changes: 0 additions & 19 deletions t/18import.t

This file was deleted.

0 comments on commit d40bc65

Please sign in to comment.