Skip to content

Commit

Permalink
Merge branch 'hotfix-0.1.4' into trunk
Browse files Browse the repository at this point in the history
- Resolve issue with optional tests loading Test::Trap.
  • Loading branch information
Xiong committed Nov 20, 2011
2 parents 91cbaf0 + fbb3f09 commit 0675e5e
Show file tree
Hide file tree
Showing 17 changed files with 373 additions and 71 deletions.
2 changes: 1 addition & 1 deletion README
@@ -1,4 +1,4 @@
Error-Base version v0.1.3
Error-Base version v0.1.4

J'avais cru plus difficile de mourir.
-- Louis XIV
Expand Down
2 changes: 1 addition & 1 deletion README~
@@ -1,4 +1,4 @@
Error-Base version v0.1.2
Error-Base version v0.1.3

J'avais cru plus difficile de mourir.
-- Louis XIV
Expand Down
6 changes: 3 additions & 3 deletions lib/Error/Base.pm
Expand Up @@ -9,7 +9,7 @@ package Error::Base;
use 5.008008;
use strict;
use warnings;
use version; our $VERSION = qv('v0.1.3');
use version; our $VERSION = qv('v0.1.4');

# Core modules
use overload # Overload Perl operations
Expand Down Expand Up @@ -374,7 +374,7 @@ sub _join_local {
#
sub _paired {
if ( scalar @_ % 2 ) { # an odd number modulo 2 is one: true
die 'Error::Base internal error: unpaired args: ', $!;
die 'Error::Base internal error: unpaired args';
};
return @_;
}; ## _paired
Expand Down Expand Up @@ -636,7 +636,7 @@ Error::Base - Simple structured errors with full backtrace
=head1 VERSION
This document describes Error::Base version v0.1.3
This document describes Error::Base version v0.1.4
=head1 SYNOPSIS
Expand Down
15 changes: 11 additions & 4 deletions lib/Error/Base.pm~
Expand Up @@ -9,7 +9,7 @@ package Error::Base;
use 5.008008;
use strict;
use warnings;
use version; our $VERSION = qv('v0.1.2');
use version; our $VERSION = qv('v0.1.3');

# Core modules
use overload # Overload Perl operations
Expand Down Expand Up @@ -56,7 +56,7 @@ sub _stringify {
return join qq{\n}, @{ $self->{-lines} }, q{};
}
else {
return 'Error::Base internal error: failed to stringify $self';
return 'Error::Base internal error: stringifing unthrown object';
};

}; ## _stringify
Expand Down Expand Up @@ -374,7 +374,7 @@ sub _join_local {
#
sub _paired {
if ( scalar @_ % 2 ) { # an odd number modulo 2 is one: true
die 'Error::Base internal error: unpaired args: ', $!;
die 'Error::Base internal error: unpaired args';
};
return @_;
}; ## _paired
Expand Down Expand Up @@ -636,7 +636,7 @@ Error::Base - Simple structured errors with full backtrace

=head1 VERSION

This document describes Error::Base version v0.1.2
This document describes Error::Base version v0.1.3

=head1 SYNOPSIS

Expand Down Expand Up @@ -982,6 +982,13 @@ or hash. Don't pass such references as values to any key with the wrong sigil.

Called a method without class or object. Did you call as function?

=item C<< stringifing unthrown object >>

An object of this class will stringify to its printable error message
(including backtrace if any) when thrown. There is nothing to see (yet) if
you try to print an object that has been constructed but not (yet) thrown.
This error is not fatal; it is returned as the stringification.

=item C<< in _late eval: >>

Attempted to late-interpolate badly. Check your code. The interpolation
Expand Down
4 changes: 2 additions & 2 deletions lib/Error/Base/Cookbook.pm
Expand Up @@ -3,7 +3,7 @@ package Error::Base::Cookbook;
use 5.008008;
use strict;
use warnings;
use version; our $VERSION = qv('v0.1.3');
use version; our $VERSION = qv('v0.1.4');

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
Expand Down Expand Up @@ -39,7 +39,7 @@ Error::Base::Cookbook - Examples of Error::Base usage
=head1 VERSION
This document describes Error::Base version v0.1.3
This document describes Error::Base version v0.1.4
=head1 DESCRIPTION
Expand Down
4 changes: 2 additions & 2 deletions lib/Error/Base/Cookbook.pm~
Expand Up @@ -3,7 +3,7 @@ package Error::Base::Cookbook;
use 5.008008;
use strict;
use warnings;
use version; our $VERSION = qv('v0.1.2');
use version; our $VERSION = qv('v0.1.3');

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
Expand Down Expand Up @@ -39,7 +39,7 @@ Error::Base::Cookbook - Examples of Error::Base usage

=head1 VERSION

This document describes Error::Base version v0.1.2
This document describes Error::Base version v0.1.3

=head1 DESCRIPTION

Expand Down
3 changes: 3 additions & 0 deletions top/Changes
@@ -1,5 +1,8 @@
Revision history for Error-Base

v0.1.4 2011-11-19 16:10:47
- Resolve issue with optional tests loading Test::Trap.

v0.1.3 2011-11-18 18:19:00
- Enforce strictures and warnings in _late() string eval.
- Test internal error conditions.
Expand Down
21 changes: 12 additions & 9 deletions xt/err/310-ex-backtrace.t
Expand Up @@ -23,22 +23,25 @@ my $self ;

# Load non-core modules conditionally
BEGIN{
my $diag = 'load-test-trap';
eval{
require Test::Trap; # Block eval on steroids
Test::Trap->import (qw/ :default /);
};
$::module_loaded = !$@; # loaded if no error
my $module_loaded = !$@; # loaded if no error
# must be package variable
# to escape BEGIN block
}; ## BEGIN
if ( $module_loaded ) {
note($diag);
}
else {
diag('Test::Trap required to execute this test script; skipping.');
pass;
done_testing(1);
exit 0;
};

$tc++;
$diag = $base . 'load-test-trap';
pass($diag);
if ( not $::module_loaded ) {
note('Test::Trap (recommended) required to execute this test script.');
exit 0;
};
}; ## BEGIN

#----------------------------------------------------------------------------#

Expand Down
21 changes: 12 additions & 9 deletions xt/err/315-no-self.t
Expand Up @@ -23,22 +23,25 @@ my $self ;

# Load non-core modules conditionally
BEGIN{
my $diag = 'load-test-trap';
eval{
require Test::Trap; # Block eval on steroids
Test::Trap->import (qw/ :default /);
};
$::module_loaded = !$@; # loaded if no error
my $module_loaded = !$@; # loaded if no error
# must be package variable
# to escape BEGIN block
}; ## BEGIN
if ( $module_loaded ) {
note($diag);
}
else {
diag('Test::Trap required to execute this test script; skipping.');
pass;
done_testing(1);
exit 0;
};

$tc++;
$diag = $base . 'load-test-trap';
pass($diag);
if ( not $::module_loaded ) {
note('Test::Trap (recommended) required to execute this test script.');
exit 0;
};
}; ## BEGIN

#----------------------------------------------------------------------------#

Expand Down
21 changes: 12 additions & 9 deletions xt/err/320-bad-reftype.t
Expand Up @@ -23,22 +23,25 @@ my $self ;

# Load non-core modules conditionally
BEGIN{
my $diag = 'load-test-trap';
eval{
require Test::Trap; # Block eval on steroids
Test::Trap->import (qw/ :default /);
};
$::module_loaded = !$@; # loaded if no error
my $module_loaded = !$@; # loaded if no error
# must be package variable
# to escape BEGIN block
}; ## BEGIN
if ( $module_loaded ) {
note($diag);
}
else {
diag('Test::Trap required to execute this test script; skipping.');
pass;
done_testing(1);
exit 0;
};

$tc++;
$diag = $base . 'load-test-trap';
pass($diag);
if ( not $::module_loaded ) {
note('Test::Trap (recommended) required to execute this test script.');
exit 0;
};
}; ## BEGIN

#----------------------------------------------------------------------------#

Expand Down
21 changes: 12 additions & 9 deletions xt/err/325-unthrown.t
Expand Up @@ -23,22 +23,25 @@ my $self ;

# Load non-core modules conditionally
BEGIN{
my $diag = 'load-test-trap';
eval{
require Test::Trap; # Block eval on steroids
Test::Trap->import (qw/ :default /);
};
$::module_loaded = !$@; # loaded if no error
my $module_loaded = !$@; # loaded if no error
# must be package variable
# to escape BEGIN block
}; ## BEGIN
if ( $module_loaded ) {
note($diag);
}
else {
diag('Test::Trap required to execute this test script; skipping.');
pass;
done_testing(1);
exit 0;
};

$tc++;
$diag = $base . 'load-test-trap';
pass($diag);
if ( not $::module_loaded ) {
note('Test::Trap (recommended) required to execute this test script.');
exit 0;
};
}; ## BEGIN

#----------------------------------------------------------------------------#

Expand Down

0 comments on commit 0675e5e

Please sign in to comment.