Skip to content

Commit

Permalink
Fix tests with -Ddefault_inc_excludes_dot
Browse files Browse the repository at this point in the history
Closes #1
  • Loading branch information
kentfredric committed Mar 5, 2017
1 parent 7363d74 commit f3f482a
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 22 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ branches:
- releases
install:
- time perl ./maint-travis-ci/install_deps_early.pl
- time perl ./maint-travis-ci/install_deps.pl
- time perl ./maint-travis-ci/autoinstall_dzil.pl
- time perl ./maint-travis-ci/install_deps_2.pl
language: perl
matrix:
allow_failures:
Expand Down
10 changes: 10 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Release history for Gentoo-PerlMod-Version

{{$NEXT}}
[Bugfix]
- Fix test problems with -Ddefault_inc_excludes_dot
- Closes https://github.com/kentnl/Gentoo-PerlMod-Version/issues/1

[Dependencies::Stats]
- Dependencies changed since 0.8.0, see misc/*.deps* for details
- develop: +2 ↑2 (suggests: ↑2)

[Misc]
- Version scheme now includes a "v" due to upstream tooling constraints

0.8.0 2015-07-16T23:24:29Z 301fe54
[00 Major / Features]
Expand Down
6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This software is copyright (c) 2015 by Kent Fredric <kentnl@cpan.org>.
This software is copyright (c) 2017 by Kent Fredric <kentnl@cpan.org>.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
Expand All @@ -12,7 +12,7 @@ b) the "Artistic License"

--- The GNU General Public License, Version 1, February 1989 ---

This software is Copyright (c) 2015 by Kent Fredric <kentnl@cpan.org>.
This software is Copyright (c) 2017 by Kent Fredric <kentnl@cpan.org>.

This is free software, licensed under:

Expand Down Expand Up @@ -272,7 +272,7 @@ That's all there is to it!

--- The Artistic License 1.0 ---

This software is Copyright (c) 2015 by Kent Fredric <kentnl@cpan.org>.
This software is Copyright (c) 2017 by Kent Fredric <kentnl@cpan.org>.

This is free software, licensed under:

Expand Down
4 changes: 2 additions & 2 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.037.
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.009.
use strict;
use warnings;

Expand Down Expand Up @@ -35,7 +35,7 @@ my %WriteMakefileArgs = (
"Test::Fatal" => 0,
"Test::More" => "0.96"
},
"VERSION" => "0.8.1",
"VERSION" => "v0.8.1",
"test" => {
"TESTS" => "t/*.t t/00-compile/*.t"
}
Expand Down
4 changes: 2 additions & 2 deletions README.mkdn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Gentoo::PerlMod::Version - Convert arbitrary Perl Modules' versions into normali

# VERSION

version 0.8.1
version v0.8.1

# SYNOPSIS

Expand Down Expand Up @@ -199,7 +199,7 @@ Kent Fredric <kentnl@cpan.org>

# COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Kent Fredric <kentnl@cpan.org>.
This software is copyright (c) 2017 by Kent Fredric <kentnl@cpan.org>.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
22 changes: 12 additions & 10 deletions bin/gentoo-perlmod-version.pl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BEGIN
GENTOO_PERLMOD_VERSION_ERROR

$fatpacked{"Sub/Exporter/Progressive.pm"} = '#line '.(1+__LINE__).' "'.__FILE__."\"\n".<<'SUB_EXPORTER_PROGRESSIVE';
package Sub::Exporter::Progressive;use strict;use warnings;our$VERSION='0.001011';use Carp ();use List::Util ();sub import {my ($self,@args)=@_;my$inner_target=caller;my$export_data=sub_export_options($inner_target,@args);my$full_exporter;no strict 'refs';@{"${inner_target}::EXPORT_OK"}=@{$export_data->{exports}};@{"${inner_target}::EXPORT"}=@{$export_data->{defaults}};%{"${inner_target}::EXPORT_TAGS"}=%{$export_data->{tags}};*{"${inner_target}::import"}=sub {use strict;my ($self,@args)=@_;if (List::Util::first {ref ||!m/ \A [:-]? \w+ \z /xm}@args){Carp::croak 'your usage of Sub::Exporter::Progressive requires Sub::Exporter to be installed' unless eval {require Sub::Exporter};$full_exporter ||= Sub::Exporter::build_exporter($export_data->{original});goto$full_exporter}elsif (defined(my$num=List::Util::first {!ref and m/^\d/}@args)){die "cannot export symbols with a leading digit: '$num'"}else {require Exporter;s/ \A - /:/xm for@args;@_=($self,@args);goto \&Exporter::import}};return}my$too_complicated=<<'DEATH';sub sub_export_options {my ($inner_target,$setup,$options)=@_;my@exports;my@defaults;my%tags;if ($setup eq '-setup'){my%options=%$options;OPTIONS: for my$opt (keys%options){if ($opt eq 'exports'){Carp::croak$too_complicated if ref$options{exports}ne 'ARRAY';@exports=@{$options{exports}};Carp::croak$too_complicated if List::Util::first {ref}@exports}elsif ($opt eq 'groups'){%tags=%{$options{groups}};for my$tagset (values%tags){Carp::croak$too_complicated if List::Util::first {/ \A - (?! all \b ) /x || ref}@{$tagset}}@defaults=@{$tags{default}|| []}}else {Carp::croak$too_complicated}}@{$_}=map {/ \A [:-] all \z /x ? @exports : $_}@{$_}for \@defaults,values%tags;$tags{all}||= [@exports ];my%exports=map {$_=>1}@exports;my@errors=grep {not $exports{$_}}@defaults;Carp::croak join(', ',@errors)." is not exported by the $inner_target module\n" if@errors}return {exports=>\@exports,defaults=>\@defaults,original=>$options,tags=>\%tags,}}1;
package Sub::Exporter::Progressive;$Sub::Exporter::Progressive::VERSION='0.001013';use strict;use warnings;sub _croak {require Carp;&Carp::croak}sub import {my ($self,@args)=@_;my$inner_target=caller;my$export_data=sub_export_options($inner_target,@args);my$full_exporter;no strict 'refs';no warnings 'once';@{"${inner_target}::EXPORT_OK"}=@{$export_data->{exports}};@{"${inner_target}::EXPORT"}=@{$export_data->{defaults}};%{"${inner_target}::EXPORT_TAGS"}=%{$export_data->{tags}};*{"${inner_target}::import"}=sub {use strict;my ($self,@args)=@_;if (grep {length ref $_ or $_ !~ / \A [:-]? \w+ \z /xm}@args){_croak 'your usage of Sub::Exporter::Progressive requires Sub::Exporter to be installed' unless eval {require Sub::Exporter};$full_exporter ||= Sub::Exporter::build_exporter($export_data->{original});goto$full_exporter}elsif (defined((my ($num)=grep {m/^\d/}@args)[0])){_croak "cannot export symbols with a leading digit: '$num'"}else {require Exporter;s/ \A - /:/xm for@args;@_=($self,@args);goto \&Exporter::import}};return}my$too_complicated=<<'DEATH';sub sub_export_options {my ($inner_target,$setup,$options)=@_;my@exports;my@defaults;my%tags;if (($setup||'')eq '-setup'){my%options=%$options;OPTIONS: for my$opt (keys%options){if ($opt eq 'exports'){_croak$too_complicated if ref$options{exports}ne 'ARRAY';@exports=@{$options{exports}};_croak$too_complicated if grep {length ref $_}@exports}elsif ($opt eq 'groups'){%tags=%{$options{groups}};for my$tagset (values%tags){_croak$too_complicated if grep {length ref $_ or $_ =~ / \A - (?! all \b ) /x}@{$tagset}}@defaults=@{$tags{default}|| []}}else {_croak$too_complicated}}@{$_}=map {/ \A [:-] all \z /x ? @exports : $_}@{$_}for \@defaults,values%tags;$tags{all}||= [@exports ];my%exports=map {$_=>1}@exports;my@errors=grep {not $exports{$_}}@defaults;_croak join(', ',@errors)." is not exported by the $inner_target module\n" if@errors}return {exports=>\@exports,defaults=>\@defaults,original=>$options,tags=>\%tags,}}1;
You are using Sub::Exporter::Progressive, but the features your program uses from
Sub::Exporter cannot be implemented without Sub::Exporter, so you might as well
just use vanilla Sub::Exporter
Expand All @@ -34,15 +34,17 @@ BEGIN

if ($] < 5.008) {
*{"${class}::INC"} = sub {
if (my $fat = $_[0]{$_[1]}) {
return sub {
return 0 unless length $fat;
$fat =~ s/^([^\n]*\n?)//;
$_ = $1;
return 1;
};
}
return;
if (my $fat = $_[0]{$_[1]}) {
my $pos = 0;
my $last = length $fat;
return (sub {
return 0 if $pos == $last;
my $next = (1 + index $fat, "\n", $pos) || $last;
$_ .= substr $fat, $pos, $next - $pos;
$pos = $next;
return 1;
});
}
};
}

Expand Down
8 changes: 5 additions & 3 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@ copy = Makefile.PL
trailing_whitespace = 1

[Test::Compile::PerFile / @Author::KENTNL/Test::Compile::PerFile]
:version = 0.003902
test_template = 02-raw-require.t.tpl

[Test::Perl::Critic / @Author::KENTNL/Test::Perl::Critic]

[ManifestSkip / @Author::KENTNL/ManifestSkip]

[RewriteVersion::Sanitized / @Author::KENTNL/RewriteVersion::Sanitized]
mantissa = 6
normal_form = normal_3
normal_form = normal

[PodWeaver / @Author::KENTNL/PodWeaver]
replacer = replace_with_blank
Expand All @@ -93,7 +95,7 @@ finder = :InstallModules
-phase = develop
-type = suggests
Dist::Zilla::App::Command::bakeini = 0.001000
Dist::Zilla::PluginBundle::Author::KENTNL = 2.025001
Dist::Zilla::PluginBundle::Author::KENTNL = 2.025021

[Prereqs::AuthorDeps / @Author::KENTNL/Prereqs::AuthorDeps]

Expand Down Expand Up @@ -232,7 +234,7 @@ Dist::Zilla::Plugin::RemovePrereqs::Provided = 0
Dist::Zilla::Plugin::RewriteVersion::Sanitized = 0
Dist::Zilla::Plugin::RunExtraTests = 0
Dist::Zilla::Plugin::Test::CPAN::Changes = 0
Dist::Zilla::Plugin::Test::Compile::PerFile = 0
Dist::Zilla::Plugin::Test::Compile::PerFile = 0.003902
Dist::Zilla::Plugin::Test::EOL = 0
Dist::Zilla::Plugin::Test::Kwalitee = 0
Dist::Zilla::Plugin::Test::Perl::Critic = 0
Expand Down
2 changes: 1 addition & 1 deletion dist.ini.meta
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ copyright_holder = Kent Fredric <kentnl@cpan.org>

[@Author::KENTNL]
bumpversions = 1
normal_form = normal_3
normal_form = normal
toolkit = eumm
toolkit_hardness = soft
srcreadme = mkdn
Expand Down
11 changes: 11 additions & 0 deletions misc/Changes.deps.all
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
This file contains ALL changes in dependencies in both REQUIRED / OPTIONAL dependencies for all phases (configure/build/runtime/test/develop)

0.8.1
[Added / develop requires]
- English
- Software::License::Perl_5

[Changed / develop requires]
- Dist::Zilla::Plugin::Test::Compile::PerFile 0 → 0.003902
- Test::More 0.88 → 0.96

[Changed / develop suggests]
- Dist::Zilla::App::Command::bakeini 0.002005 → 0.002006
- Dist::Zilla::PluginBundle::Author::KENTNL 2.025001 → 2.025021

0.8.0 2015-07-16T23:24:29Z
[Added / develop requires]
Expand Down
11 changes: 11 additions & 0 deletions misc/Changes.deps.dev
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
This file contains changes to DEVELOPMENT dependencies only ( both REQUIRED and OPTIONAL )

0.8.1
[Added / develop requires]
- English
- Software::License::Perl_5

[Changed / develop requires]
- Dist::Zilla::Plugin::Test::Compile::PerFile 0 → 0.003902
- Test::More 0.88 → 0.96

[Changed / develop suggests]
- Dist::Zilla::App::Command::bakeini 0.002005 → 0.002006
- Dist::Zilla::PluginBundle::Author::KENTNL 2.025001 → 2.025021

0.8.0 2015-07-16T23:24:29Z
[Added / develop requires]
Expand Down

0 comments on commit f3f482a

Please sign in to comment.