Skip to content

Commit

Permalink
Move WriteTestVariants to Test::WriteVariants
Browse files Browse the repository at this point in the history
  • Loading branch information
timbunce committed Mar 15, 2014
1 parent acf8c9d commit 028674f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package WriteTestVariants;
package Test::WriteVariants;

use strict;
use warnings;
Expand Down Expand Up @@ -46,7 +46,7 @@ use Class::Tiny {

sub write_test_variants {
my ($self, %args) = @_;

my $search_path = delete $args{search_path}
or croak "search_path not specified";
my $search_dirs = delete $args{search_dirs};
Expand Down Expand Up @@ -136,6 +136,8 @@ sub get_input_tests {
my $namespaces_regex = join "|", map { quotemeta($_) } @$namespaces;
my $namespaces_qr = qr/^($namespaces_regex)::/;

# XXX also find .t files?

my @test_case_modules = Module::Pluggable::Object->new(
require => 0,
%$search_opts,
Expand All @@ -147,6 +149,7 @@ sub get_input_tests {
# map module name, without the namespace prefix, to a dir path
my $test_name = $module_name;
$test_name =~ s/$namespaces_qr//;
$test_name =~ s{[^\w:]+}{_}g;
$test_name =~ s{::}{/}g;

die "Test name $test_name already seen ($module_name)"
Expand Down
4 changes: 2 additions & 2 deletions sandbox/tim/tumbler.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

use lib 'lib';

use WriteTestVariants;
use Test::WriteVariants;

$| = 1;
my $output_dir = "out";

rename $output_dir, $output_dir.'-'.time
if -d $output_dir;

my $test_writer = WriteTestVariants->new();
my $test_writer = Test::WriteVariants->new();

$test_writer->write_test_variants(
search_path => [
Expand Down

0 comments on commit 028674f

Please sign in to comment.