X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=author%2Fextract-inline-tests;h=77fb2466502eb15fc2ed9881f3c797579bdd09ea;hb=85592815da28bbf09d153c9d80afb47fecd8f0c7;hp=d91fa4303aebb82317501d8ec477e506aa531a28;hpb=c3ad9761b2a6ca31f9a8f1057b1d15d7444b56b0;p=gitmo%2FMoose.git diff --git a/author/extract-inline-tests b/author/extract-inline-tests index d91fa43..77fb246 100755 --- a/author/extract-inline-tests +++ b/author/extract-inline-tests @@ -27,9 +27,10 @@ use warnings; \n=for[ \t]+example[ \t]+end\s*? # ... until the =for example end (?:\n|$) # ... at the end of file or a newline | # OR - =begin[ \t]+(?:test|testing)\b # ... when we find a =begin test or testing - .*? # ... and keep capturing - \n=end[ \t]+(?:test|testing)\s*? # ... until an =end tag + =begin[ \t]+(?:test|testing)(?:-SETUP)? # ... when we find a =begin test or testing + .*? # ... and keep capturing + \n=end[ \t]+(?:test|testing)(?:-SETUP)? # ... until an =end tag + .*? (?:\n|$) # ... at the end of file or a newline ) # ... and stop capturing /isx; @@ -42,10 +43,14 @@ use warnings; # A hack to turn the SYNOPSIS into something Test::Inline # doesn't barf on - if ( $elt =~ s/=head1[ \t]+SYNOPSIS/=begin testing SETUP\n\n{/ ) { - $elt .= "}\n\n=end testing SETUP"; + if ( $elt =~ s/=head1[ \t]+SYNOPSIS/=begin testing-SETUP\n\n{/ ) { + $elt .= "}\n\n=end testing-SETUP"; } + # It seems like search.cpan doesn't like a name with + # spaces after =begin. bleah, what a mess. + $elt =~ s/testing-SETUP/testing SETUP/g; + push @elements, $elt; }