Hello community,
here is the log from the commit of package perl-Contextual-Return for
openSUSE:Factory checked in at 2012-12-21 10:31:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Contextual-Return (Old)
and /work/SRC/openSUSE:Factory/.perl-Contextual-Return.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Contextual-Return", Maintainer is ""
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Contextual-Return/perl-Contextual-Return.changes
2012-09-06 09:00:05.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Contextual-Return.new/perl-Contextual-Return.changes
2012-12-21 10:31:45.000000000 +0100
@@ -1,0 +2,20 @@
+Mon Dec 17 14:06:41 UTC 2012 - [email protected]
+
+- update to 0.004007
+ - Further patch to failures.t
+ - Added redefinition of Scalar::Util::blessed() to avoid nasty
+ surprises (thanks Andrew!)
+ - Added confess() and cluck() overrides
+ and fixed caller() override to set @DB::args when appropriate
+ - Further patch for t/confess.t
+ (Thanks, David!)
+ - Circumvented annoying undef-as-key warnings in Perl 5.17+
+ - Honour @CARP_NOT's when reporting context
+ - Added BLESSED handler for better control over how blessed() lies
+ - Upgraded reimplementation of blessed() to make more sense
+
+- reanable tests for ARM (fixed upstream)
+- fix ppc test failures
+- provide Build.PL to be able to use create_packlist=0
+
+-------------------------------------------------------------------
Old:
----
Contextual-Return-0.004003.tar.gz
New:
----
Build.PL
Contextual-Return-0.004007.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Contextual-Return.spec ++++++
--- /var/tmp/diff_new_pack.n7DKJs/_old 2012-12-21 10:31:46.000000000 +0100
+++ /var/tmp/diff_new_pack.n7DKJs/_new 2012-12-21 10:31:46.000000000 +0100
@@ -17,7 +17,7 @@
Name: perl-Contextual-Return
-Version: 0.004003
+Version: 0.004007
Release: 0
%define cpan_name Contextual-Return
Summary: Create context-sensitive return values
@@ -25,6 +25,7 @@
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Contextual-Return/
Source:
http://www.cpan.org/authors/id/D/DC/DCONWAY/%{cpan_name}-%{version}.tar.gz
+Source1: Build.PL
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
@@ -88,16 +89,13 @@
%prep
%setup -q -n %{cpan_name}-%{version}
+cp %{S:1} ./
%build
%{__perl} Build.PL installdirs=vendor
./Build build flags=%{?_smp_mflags}
%check
-# doesn't work for ARM
-if test "%_host_cpu" = "armv7hl"; then
- rm -f t/failures.t
-fi
./Build test
%install
++++++ Build.PL ++++++
use strict;
use warnings;
use Module::Build;
my $builder = Module::Build->new(
module_name => 'Contextual::Return',
license => 'perl',
dist_author => 'Damian Conway <[email protected]>',
dist_version_from => 'lib/Contextual/Return.pm',
requires => {
'Test::More' => 0,
'version' => 0,
'Want' => 0,
},
add_to_cleanup => [ 'Contextual-Return-*' ],
);
$builder->create_build_script();
++++++ Contextual-Return-0.004003.tar.gz -> Contextual-Return-0.004007.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Contextual-Return-0.004003/Build.PL
new/Contextual-Return-0.004007/Build.PL
--- old/Contextual-Return-0.004003/Build.PL 2006-02-13 01:54:33.000000000
+0100
+++ new/Contextual-Return-0.004007/Build.PL 1970-01-01 01:00:00.000000000
+0100
@@ -1,18 +0,0 @@
-use strict;
-use warnings;
-use Module::Build;
-
-my $builder = Module::Build->new(
- module_name => 'Contextual::Return',
- license => 'perl',
- dist_author => 'Damian Conway <[email protected]>',
- dist_version_from => 'lib/Contextual/Return.pm',
- requires => {
- 'Test::More' => 0,
- 'version' => 0,
- 'Want' => 0,
- },
- add_to_cleanup => [ 'Contextual-Return-*' ],
-);
-
-$builder->create_build_script();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Contextual-Return-0.004003/Changes
new/Contextual-Return-0.004007/Changes
--- old/Contextual-Return-0.004003/Changes 2012-04-11 08:55:49.000000000
+0200
+++ new/Contextual-Return-0.004007/Changes 2012-10-06 00:05:05.000000000
+0200
@@ -115,3 +115,34 @@
- Patched failures.t to account from bleadperl changes
(thanks Zefram!)
+
+
+0.004004 Sun Aug 5 17:46:56 2012
+
+ - Further patch to failures.t
+
+ - Added redefinition of Scalar::Util::blessed() to avoid nasty
+ surprises (thanks Andrew!)
+
+ - Added confess() and cluck() overrides
+ and fixed caller() override to set @DB::args when appropriate
+
+
+0.004005 Mon Aug 20 10:44:35 2012
+
+ - Further patch for t/confess.t
+ (Thanks, David!)
+
+
+0.004006 Thu Oct 4 16:49:47 2012
+
+ - Circumvented annoying undef-as-key warnings in Perl 5.17+
+
+ - Honour @CARP_NOT's when reporting context
+
+
+0.004007 Fri Oct 5 23:05:05 2012
+
+ - Added BLESSED handler for better control over how blessed() lies
+
+ - Upgraded reimplementation of blessed() to make more sense
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Contextual-Return-0.004003/MANIFEST
new/Contextual-Return-0.004007/MANIFEST
--- old/Contextual-Return-0.004003/MANIFEST 2012-04-11 08:55:51.000000000
+0200
+++ new/Contextual-Return-0.004007/MANIFEST 2012-10-06 00:05:06.000000000
+0200
@@ -1,7 +1,5 @@
-Build.PL
Changes
MANIFEST
-META.yml # Will be created by "make dist"
Makefile.PL
README
lib/Contextual/Return.pm
@@ -37,4 +35,6 @@
t/simple_rename.t
t/try
t/STRICT.t
-META.json Module JSON meta-data (added by
MakeMaker)
+t/blessed.t
+t/confess.t
+META.yml Module meta-data (added by MakeMaker)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Contextual-Return-0.004003/META.json
new/Contextual-Return-0.004007/META.json
--- old/Contextual-Return-0.004003/META.json 2012-04-11 08:55:51.000000000
+0200
+++ new/Contextual-Return-0.004007/META.json 1970-01-01 01:00:00.000000000
+0100
@@ -1,43 +0,0 @@
-{
- "abstract" : "Create context-sensitive return values",
- "author" : [
- "Damian Conway <[email protected]>"
- ],
- "dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter
version 2.112150",
- "license" : [
- "unknown"
- ],
- "meta-spec" : {
- "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
- "version" : "2"
- },
- "name" : "Contextual-Return",
- "no_index" : {
- "directory" : [
- "t",
- "inc"
- ]
- },
- "prereqs" : {
- "build" : {
- "requires" : {
- "ExtUtils::MakeMaker" : 0
- }
- },
- "configure" : {
- "requires" : {
- "ExtUtils::MakeMaker" : 0
- }
- },
- "runtime" : {
- "requires" : {
- "Test::More" : 0,
- "Want" : 0,
- "version" : 0
- }
- }
- },
- "release_status" : "stable",
- "version" : "0.004003"
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Contextual-Return-0.004003/META.yml
new/Contextual-Return-0.004007/META.yml
--- old/Contextual-Return-0.004003/META.yml 2012-04-11 08:55:51.000000000
+0200
+++ new/Contextual-Return-0.004007/META.yml 2012-10-06 00:05:06.000000000
+0200
@@ -1,24 +1,24 @@
----
-abstract: 'Create context-sensitive return values'
+--- #YAML:1.0
+name: Contextual-Return
+version: 0.004007
+abstract: Create context-sensitive return values
author:
- - 'Damian Conway <[email protected]>'
-build_requires:
- ExtUtils::MakeMaker: 0
+ - Damian Conway <[email protected]>
+license: perl
+distribution_type: module
configure_requires:
- ExtUtils::MakeMaker: 0
-dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version
2.112150'
-license: unknown
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
-name: Contextual-Return
-no_index:
- directory:
- - t
- - inc
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
requires:
- Test::More: 0
- Want: 0
- version: 0
-version: 0.004003
+ Test::More: 0
+ version: 0
+ Want: 0
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.57_05
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Contextual-Return-0.004003/Makefile.PL
new/Contextual-Return-0.004007/Makefile.PL
--- old/Contextual-Return-0.004003/Makefile.PL 2006-02-13 01:54:40.000000000
+0100
+++ new/Contextual-Return-0.004007/Makefile.PL 2012-04-12 20:54:04.000000000
+0200
@@ -7,6 +7,7 @@
AUTHOR => 'Damian Conway <[email protected]>',
VERSION_FROM => 'lib/Contextual/Return.pm',
ABSTRACT_FROM => 'lib/Contextual/Return.pm',
+ LICENSE => 'perl',
PL_FILES => {},
PREREQ_PM => {
'Test::More' => 0,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Contextual-Return-0.004003/README
new/Contextual-Return-0.004007/README
--- old/Contextual-Return-0.004003/README 2012-04-11 08:55:49.000000000
+0200
+++ new/Contextual-Return-0.004007/README 2012-10-06 00:05:05.000000000
+0200
@@ -1,4 +1,4 @@
-Contextual::Return version 0.004003
+Contextual::Return version 0.004007
This module provides a collection of named blocks that allow a return
statement to return different values depending on the context in which it's
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Contextual-Return-0.004003/lib/Contextual/Return/Failure.pm
new/Contextual-Return-0.004007/lib/Contextual/Return/Failure.pm
--- old/Contextual-Return-0.004003/lib/Contextual/Return/Failure.pm
2010-10-04 06:30:30.000000000 +0200
+++ new/Contextual-Return-0.004007/lib/Contextual/Return/Failure.pm
2012-09-07 05:23:20.000000000 +0200
@@ -104,10 +104,10 @@
if (ref $exception) {
my $message = "$exception";
$message =~ s/$/\n/;
- die _in_context $message, "Attempted to use failure value"
+ die _in_context $message, "Attempted to use failure value";
}
else {
- die _in_context $exception, "Attempted to use failure value"
+ die _in_context $exception, "Attempted to use failure value";
}
}
METHOD {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Contextual-Return-0.004003/lib/Contextual/Return.pm
new/Contextual-Return-0.004007/lib/Contextual/Return.pm
--- old/Contextual-Return-0.004003/lib/Contextual/Return.pm 2012-04-11
08:55:49.000000000 +0200
+++ new/Contextual-Return-0.004007/lib/Contextual/Return.pm 2012-10-06
00:05:05.000000000 +0200
@@ -1,21 +1,38 @@
package Contextual::Return;
-# Fake out CORE::GLOBAL::caller and Carp very early...
+my %attrs_of;
+
+# Fake out CORE::GLOBAL::caller, Carp::*, and Scalar::Util::blessed() very
early...
BEGIN {
no warnings 'redefine';
my $fallback_caller = *CORE::GLOBAL::caller{CODE};
*CORE::GLOBAL::caller = sub {
my ($uplevels) = shift || 0;
- if ($fallback_caller) {
- return $fallback_caller->($uplevels + 2 +
$Contextual::Return::uplevel)
- if $Contextual::Return::uplevel;
- return $fallback_caller->($uplevels + 1);
+ if (CORE::caller eq 'DB') {
+ package DB;
+ if ($fallback_caller) {
+ return $fallback_caller->($uplevels + 2 +
$Contextual::Return::uplevel)
+ if $Contextual::Return::uplevel;
+ return $fallback_caller->($uplevels + 1);
+ }
+ else {
+ return CORE::caller($uplevels + 2 +
$Contextual::Return::uplevel)
+ if $Contextual::Return::uplevel;
+ return CORE::caller($uplevels + 1);
+ }
}
else {
- return CORE::caller($uplevels + 2 + $Contextual::Return::uplevel)
- if $Contextual::Return::uplevel;
- return CORE::caller($uplevels + 1);
+ if ($fallback_caller) {
+ return $fallback_caller->($uplevels + 2 +
$Contextual::Return::uplevel)
+ if $Contextual::Return::uplevel;
+ return $fallback_caller->($uplevels + 1);
+ }
+ else {
+ return CORE::caller($uplevels + 2 +
$Contextual::Return::uplevel)
+ if $Contextual::Return::uplevel;
+ return CORE::caller($uplevels + 1);
+ }
}
};
@@ -33,9 +50,44 @@
die _in_context(@_);
};
+ # Scalar::Util::blessed()...
+ use Scalar::Util 'refaddr';
+
+ # Remember the current blessed()...
+ my $original_blessing = *Scalar::Util::blessed{CODE};
+
+ # ...and replace it...
+ *Scalar::Util::blessed = sub($) {
+ # Are we operating on a CRV???
+ my $attrs = $attrs_of{refaddr $_[0] or q{}};
+
+ # If not, use the original code...
+ goto &{$original_blessing} if !$attrs;
+
+ # Does this object have a BLESSED handler???
+ if (exists $attrs->{BLESSED}) {
+ return $attrs->{BLESSED}->(@{$attrs->{args}});
+ }
+
+ # Otherwise, find the appropriate scalar handler...
+ handler:
+ for my $context (qw( OBJREF LAZY REF SCALAR VALUE NONVOID DEFAULT )) {
+ my $handler = $attrs->{$context}
+ or next handler;
+
+ my $obj_ref = eval { $handler->(@{$attrs->{args}}) };
+
+ my $was_blessed = $original_blessing->($obj_ref);
+ return $was_blessed if $was_blessed;
+ }
+
+ # Otherwise, simulate unblessed status...
+ return undef;
+ };
}
-our $VERSION = '0.004003';
+
+our $VERSION = '0.004007';
use warnings;
use strict;
@@ -64,6 +116,10 @@
# Track the call up the stack...
$LOC = qq{at $file line $line};
+ # Ignore any @CARP_NOT'ed packages
+ next STACK_FRAME
+ if do { no strict 'refs'; *{$package.'::CARP_NOT'}{ARRAY}; };
+
# Ignore transitions within original caller...
next STACK_FRAME
if $package eq $orig_package && $prev_package eq $orig_package;
@@ -98,16 +154,15 @@
GLOBREF
OBJREF
METHOD
+ BLESSED
);
-my %attrs_of;
-
my @ALL_EXPORTS = (
@CONTEXTS,
qw(
LAZY RESULT RVALUE METHOD FAIL
FIXED RECOVER LVALUE RETOBJ FAIL_WITH
- ACTIVE CLEANUP NVALUE STRICT
+ ACTIVE CLEANUP NVALUE STRICT BLESSED
)
);
@@ -271,7 +326,7 @@
no strict 'refs';
*{$modifier_name} = sub ($) {
my ($crv) = @_;
- my $attrs = $attrs_of{refaddr $crv};
+ my $attrs = $attrs_of{refaddr $crv or q{}};
# Track context...
my $wantarray = wantarray;
@@ -876,7 +931,7 @@
my $type = ref $data_ref;
return if !$type;
for my $value ( $type eq 'SCALAR' ? ${$data_ref} : @{$data_ref} ) {
- no warnings 'numeric';
+ no warnings 'numeric', 'uninitialized';
if ($value == $obj_ref) {
$value = '<<<self-reference>>>';
}
@@ -908,7 +963,7 @@
# Detect self-referential overloadings (to avoid infinite recursion)...
{
- no warnings 'numeric';
+ no warnings 'numeric', 'uninitialized';
if (ref $retval eq 'REF' && ${$retval} == ${$self}) {
return { $context => "<<<self-reference>>>" };
}
@@ -1626,7 +1681,7 @@
=head1 VERSION
-This document describes Contextual::Return version 0.004003
+This document describes Contextual::Return version 0.004007
=head1 SYNOPSIS
@@ -2160,6 +2215,8 @@
|--< GLOBREF
|
`--< OBJREF <....... METHOD
+ ^
+ :........... BLESSED
As before, each dashed arrow represents a fallback relationship. That
is, if the required context specifier isn't available, the arrows are
@@ -2209,7 +2266,7 @@
print "There are ${get_todo_tasks()}..."; # Throws an exception
-=head2 Treating returns values as objects
+=head2 Treating return values as objects
Normally, when a return value is treated as an object (i.e. has a method
called on it), Contextual::Return invokes any C<OBJREF> handler that was
@@ -2257,6 +2314,70 @@
(if it is also specified).
+=head2 Not treating return values as objects
+
+The use of C<OBJREF> and C<METHOD> are slightly complicated by the fact
+that contextual return values are themselves objects.
+
+For example, prior to version 0.4.4 of the module, if you passed a
+contextual return value to C<Scalar::Util::blessed()>, it always
+returned a true value (namely, the string: 'Contextual::Return::Value'),
+even if the return value had not specified handlers for C<OBJREF> or
+C<METHOD>.
+
+In other words, the I<implementation> of contextual return values (as
+objects) was getting in the way of the I<use> of contextual return
+values (as non-objects).
+
+So the module now also provides a C<BLESSED> handler, which allows you
+to explicitly control how contextual return values interact with
+C<Scalar::Util::blessed()>.
+
+If C<$crv> is a contextual return value, by default
+C<Scalar::Util::blessed($crv)> will now only return true if that return
+value has a C<OBJREF>, C<LAZY>, C<REF>, C<SCALAR>, C<VALUE>, C<NONVOID>,
+or C<DEFAULT> handler that in turn returns a blessed object.
+
+However if C<$crv> also provides a C<BLESSED> handler, C<blessed()>
+will return whatever that handler returns.
+
+This means:
+
+ sub simulate_non_object {
+ return BOOL { 1 }
+ NUM { 42 }
+ }
+
+ sub simulate_real_object {
+ return OBJREF { bless {}, 'My::Class' }
+ BOOL { 1 }
+ NUM { 42 }
+ }
+
+ sub simulate_faked_object {
+ return BLESSED { 'Foo' }
+ BOOL { 1 }
+ NUM { 42 }
+ }
+
+ sub simulate_previous_behaviour {
+ return BLESSED { 'Contextual::Return::Value' }
+ BOOL { 1 }
+ NUM { 42 }
+ }
+
+
+ say blessed( simulate_non_object() ); # undef
+ say blessed( simulate_real_object() ); # My::Class
+ say blessed( simulate_faked_object() ); # Foo
+ say blessed( simulate_previous_behaviour() ); # Contextual::Return::Value
+
+Typically, you either want no C<BLESSED> handler (in which case
+contextual return values pretend not to be blessed objects), or you want
+C<BLESSED { 'Contextual::Return::Value' }> for backwards compatibility
+with pre-v0.4.7 behaviour.
+
+
=head3 Preventing fallbacks
Sometimes fallbacks can be too helpful. Or sometimes you want to impose
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Contextual-Return-0.004003/t/blessed.t
new/Contextual-Return-0.004007/t/blessed.t
--- old/Contextual-Return-0.004003/t/blessed.t 1970-01-01 01:00:00.000000000
+0100
+++ new/Contextual-Return-0.004007/t/blessed.t 2012-10-05 23:30:36.000000000
+0200
@@ -0,0 +1,60 @@
+use Contextual::Return;
+
+sub blessed_obj { return bless {}, 'Blessed' }
+sub unblessed_obj { return 42 }
+
+sub blessed_OBJREF { return OBJREF { bless {}, 'Blessed' } }
+sub blessed_REF { return REF { bless {}, 'Blessed' } }
+sub blessed_SCALAR { return SCALAR { bless {}, 'Blessed' } }
+sub blessed_VALUE { return VALUE { bless {}, 'Blessed' } }
+sub blessed_NONVOID { return NONVOID { bless {}, 'Blessed' } }
+sub blessed_DEFAULT { return DEFAULT { bless {}, 'Blessed' } }
+sub blessed_BLESSED { return BLESSED { 'EXPLICITLY_BLESSED' } }
+
+sub unblessed_OBJREF { return OBJREF { 'unblessed' } }
+sub unblessed_REF { return REF { 'unblessed' } }
+sub unblessed_SCALAR { return SCALAR { 'unblessed' } }
+sub unblessed_VALUE { return VALUE { 'unblessed' } }
+sub unblessed_NONVOID { return NONVOID { 'unblessed' } }
+sub unblessed_DEFAULT { return DEFAULT { 'unblessed' } }
+sub unblessed_BLESSED { return BLESSED { undef } }
+
+package Other;
+use Test::More 'no_plan';
+use Scalar::Util 'blessed';
+
+is ref( ::blessed_obj ()), 'Blessed' => 'ref blessed obj
';
+is ref( ::blessed_OBJREF ()), 'Contextual::Return::Value' => 'ref blessed
OBJREF ';
+is ref( ::blessed_REF ()), 'Contextual::Return::Value' => 'ref blessed REF
';
+is ref( ::blessed_SCALAR ()), 'Contextual::Return::Value' => 'ref blessed
SCALAR ';
+is ref( ::blessed_VALUE ()), 'Contextual::Return::Value' => 'ref blessed
VALUE ';
+is ref( ::blessed_NONVOID()), 'Contextual::Return::Value' => 'ref blessed
NONVOID';
+is ref( ::blessed_DEFAULT()), 'Contextual::Return::Value' => 'ref blessed
DEFAULT';
+is ref( ::blessed_BLESSED()), 'Contextual::Return::Value' => 'ref blessed
BLESSED';
+
+is ref( ::unblessed_obj ()), q{} => 'ref unblessed
obj ';
+is ref( ::unblessed_OBJREF ()), 'Contextual::Return::Value' => 'ref unblessed
OBJREF ';
+is ref( ::unblessed_REF ()), 'Contextual::Return::Value' => 'ref unblessed
REF ';
+is ref( ::unblessed_SCALAR ()), 'Contextual::Return::Value' => 'ref unblessed
SCALAR ';
+is ref( ::unblessed_VALUE ()), 'Contextual::Return::Value' => 'ref unblessed
VALUE ';
+is ref( ::unblessed_NONVOID()), 'Contextual::Return::Value' => 'ref unblessed
NONVOID';
+is ref( ::unblessed_DEFAULT()), 'Contextual::Return::Value' => 'ref unblessed
DEFAULT';
+is ref( ::unblessed_BLESSED()), 'Contextual::Return::Value' => 'ref unblessed
BLESSED';
+
+is blessed( ::blessed_obj ()), 'Blessed' => 'blessed obj ';
+is blessed( ::blessed_OBJREF ()), 'Blessed' => 'blessed OBJREF ';
+is blessed( ::blessed_REF ()), 'Blessed' => 'blessed REF ';
+is blessed( ::blessed_SCALAR ()), 'Blessed' => 'blessed SCALAR ';
+is blessed( ::blessed_VALUE ()), 'Blessed' => 'blessed VALUE ';
+is blessed( ::blessed_NONVOID()), 'Blessed' => 'blessed NONVOID';
+is blessed( ::blessed_DEFAULT()), 'Blessed' => 'blessed DEFAULT';
+is blessed( ::blessed_BLESSED()), 'EXPLICITLY_BLESSED' => 'blessed BLESSED';
+
+is blessed(::unblessed_obj ()), undef() => 'unblessed obj ';
+is blessed(::unblessed_OBJREF ()), undef() => 'unblessed OBJREF ';
+is blessed(::unblessed_REF ()), undef() => 'unblessed REF ';
+is blessed(::unblessed_SCALAR ()), undef() => 'unblessed SCALAR ';
+is blessed(::unblessed_VALUE ()), undef() => 'unblessed VALUE ';
+is blessed(::unblessed_NONVOID()), undef() => 'unblessed NONVOID';
+is blessed(::unblessed_DEFAULT()), undef() => 'unblessed DEFAULT';
+is blessed(::unblessed_BLESSED()), undef() => 'unblessed BLESSED';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Contextual-Return-0.004003/t/confess.t
new/Contextual-Return-0.004007/t/confess.t
--- old/Contextual-Return-0.004003/t/confess.t 1970-01-01 01:00:00.000000000
+0100
+++ new/Contextual-Return-0.004007/t/confess.t 2012-08-20 02:42:35.000000000
+0200
@@ -0,0 +1,12 @@
+use Contextual::Return;
+use Carp;
+use Test::More tests => 3;
+
+sub f { Carp::confess("Forgive me..."); };
+ok !defined eval { f() } => 'eval fails';
+my $exception = $@;
+ like $exception, qr{line\s${\(__LINE__-3)}\.?\n.*line\s${\(__LINE__-2)}}xms
+ => 'error message';
+unlike $exception, qr{\*\* Incomplete caller override detected; \@DB::args
were not set \*\*}
+ => 'Complete override';
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Contextual-Return-0.004003/t/fail.t
new/Contextual-Return-0.004007/t/fail.t
--- old/Contextual-Return-0.004003/t/fail.t 2010-10-04 06:32:57.000000000
+0200
+++ new/Contextual-Return-0.004007/t/fail.t 2012-08-14 12:48:00.000000000
+0200
@@ -1,4 +1,4 @@
-use Contextual::Return;
+use Contextual::Return qw< FAIL FAIL_WITH >;
use Test::More 'no_plan';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Contextual-Return-0.004003/t/fail_with.t
new/Contextual-Return-0.004007/t/fail_with.t
--- old/Contextual-Return-0.004003/t/fail_with.t 2007-03-08
01:14:15.000000000 +0100
+++ new/Contextual-Return-0.004007/t/fail_with.t 2012-08-14
12:48:56.000000000 +0200
@@ -1,4 +1,4 @@
-use Contextual::Return;
+use Contextual::Return qw< FAIL FAIL_WITH >;
use Carp;
my $FAIL_SPEC_ref;
@@ -11,7 +11,7 @@
$FAIL_SPEC_ref = {
good => sub { BOOL { 0 } DEFAULT { croak 'good'} },
bad => sub { BOOL { 1 } DEFAULT { () } },
- ugly => sub { BOOL { undef } DEFAULT { croak 'ugly'} },
+ ugly => sub { BOOL { undef } DEFAULT { confess 'ugly'} },
};
Contextual::Return::FAIL_WITH $FAIL_SPEC_ref, qw(oh be a good boy);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Contextual-Return-0.004003/t/failures.t
new/Contextual-Return-0.004007/t/failures.t
--- old/Contextual-Return-0.004003/t/failures.t 2012-03-27 00:09:37.000000000
+0200
+++ new/Contextual-Return-0.004007/t/failures.t 2012-08-05 09:17:48.000000000
+0200
@@ -17,7 +17,8 @@
return sub {
# diag( "Caught warning: '@_'" );
ok $_[0] =~ $msg => "Warn msg correct at line $line";
- ok $_[0] =~ /line $line\.?\Z/ => "Line number correct at line $line";
+ ok $_[0] =~ /line $line\.?\Z/ => "Line number correct at line $line"
+ if $line;
}
}
@@ -73,5 +74,5 @@
like $exception, qr/^Can't use HASH as export specifier/
=> 'Correct exception';
-local $SIG{__WARN__} = ok_if_warn q{didn't export anything}, 1;
+local $SIG{__WARN__} = ok_if_warn q{didn't export anything};
eval 'use Contextual::Return qr/HANDLER/';
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]