r22769 - in /trunk/libcoat-perl: CHANGES debian/changelog lib/Coat.pm lib/Coat/Types.pm t/016_type_constraints.t t/020_moose_std_type_constraints.t t/022_type_coercion_datetime.t t/029_predicate_clearer.t t/032_new_with_undef.t
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Sat Jul 5 11:07:28 UTC 2008
Author: gregoa
Date: Sat Jul 5 11:07:28 2008
New Revision: 22769
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=22769
Log:
New upstream release.
Added:
trunk/libcoat-perl/t/032_new_with_undef.t
- copied unchanged from r22768, branches/upstream/libcoat-perl/current/t/032_new_with_undef.t
Modified:
trunk/libcoat-perl/CHANGES
trunk/libcoat-perl/debian/changelog
trunk/libcoat-perl/lib/Coat.pm
trunk/libcoat-perl/lib/Coat/Types.pm
trunk/libcoat-perl/t/016_type_constraints.t
trunk/libcoat-perl/t/020_moose_std_type_constraints.t
trunk/libcoat-perl/t/022_type_coercion_datetime.t
trunk/libcoat-perl/t/029_predicate_clearer.t
Modified: trunk/libcoat-perl/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcoat-perl/CHANGES?rev=22769&op=diff
==============================================================================
--- trunk/libcoat-perl/CHANGES (original)
+++ trunk/libcoat-perl/CHANGES Sat Jul 5 11:07:28 2008
@@ -1,3 +1,8 @@
+2008-07-04 -- release 0.331
+
+ * bugfix: don't set undef values to 1 during type validation)
+ * tests: don't use Test::Exception and DateTime in tests anymore.
+
2008-06-01 -- release 0.330
* Possible to coerce from an external class
Modified: trunk/libcoat-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcoat-perl/debian/changelog?rev=22769&op=diff
==============================================================================
--- trunk/libcoat-perl/debian/changelog (original)
+++ trunk/libcoat-perl/debian/changelog Sat Jul 5 11:07:28 2008
@@ -1,3 +1,9 @@
+libcoat-perl (0.331-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- gregor herrmann <gregoa at debian.org> Sat, 05 Jul 2008 13:06:07 +0200
+
libcoat-perl (0.330-1) unstable; urgency=low
* New upstream release.
Modified: trunk/libcoat-perl/lib/Coat.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcoat-perl/lib/Coat.pm?rev=22769&op=diff
==============================================================================
--- trunk/libcoat-perl/lib/Coat.pm (original)
+++ trunk/libcoat-perl/lib/Coat.pm Sat Jul 5 11:07:28 2008
@@ -14,7 +14,7 @@
use Coat::Object;
use Coat::Types;
-$VERSION = '0.330';
+$VERSION = '0.331';
$AUTHORITY = 'cpan:SUKRIA';
# our exported keywords for class description
Modified: trunk/libcoat-perl/lib/Coat/Types.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcoat-perl/lib/Coat/Types.pm?rev=22769&op=diff
==============================================================================
--- trunk/libcoat-perl/lib/Coat/Types.pm (original)
+++ trunk/libcoat-perl/lib/Coat/Types.pm Sat Jul 5 11:07:28 2008
@@ -152,7 +152,7 @@
if ($attr->{required} && ! defined $value);
# Bypass the type check if not defined and not required
- return 1 if (! defined $value && ! $attr->{required});
+ return $value if (! defined $value && ! $attr->{required});
# get the current TypeConstraint object
my $tc = (_is_parameterized_type_constraint( $type_name ))
Modified: trunk/libcoat-perl/t/016_type_constraints.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcoat-perl/t/016_type_constraints.t?rev=22769&op=diff
==============================================================================
--- trunk/libcoat-perl/t/016_type_constraints.t (original)
+++ trunk/libcoat-perl/t/016_type_constraints.t Sat Jul 5 11:07:28 2008
@@ -2,7 +2,6 @@
use warnings;
use Test::More 'no_plan';
-use Test::Exception;
BEGIN {
use_ok('Coat');
@@ -44,15 +43,15 @@
is($foo->boo, 50, '... got the right boo');
}
-throws_ok {
- Foo->new(bar => 10, baz => undef);
-} qr/^Attribute \(baz\) is required and cannot be undef/, '... must supply all the required attribute';
+eval { Foo->new(bar => 10, baz => undef) };
+ok( $@ =~ /^Attribute \(baz\) is required and cannot be undef/,
+ '... must supply all the required attribute');
-throws_ok {
- Foo->new(bar => 10, boo => undef);
-} qr/^Attribute \(boo\) is required and cannot be undef/, '... must supply all the required attribute';
+eval { Foo->new(bar => 10, boo => undef) };
+ok( $@ =~ /^Attribute \(boo\) is required and cannot be undef/,
+ '... must supply all the required attribute');
-throws_ok {
- Foo->new;
-} qr/^Attribute \(bar\) is required/, '... must supply all the required attribute';
+eval { Foo->new };
+ok( $@ =~ /^Attribute \(bar\) is required/,
+ '... must supply all the required attribute');
Modified: trunk/libcoat-perl/t/020_moose_std_type_constraints.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcoat-perl/t/020_moose_std_type_constraints.t?rev=22769&op=diff
==============================================================================
--- trunk/libcoat-perl/t/020_moose_std_type_constraints.t (original)
+++ trunk/libcoat-perl/t/020_moose_std_type_constraints.t Sat Jul 5 11:07:28 2008
@@ -4,7 +4,6 @@
use warnings;
use Test::More 'no_plan';
-use Test::Exception;
use Scalar::Util ();
Modified: trunk/libcoat-perl/t/022_type_coercion_datetime.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcoat-perl/t/022_type_coercion_datetime.t?rev=22769&op=diff
==============================================================================
--- trunk/libcoat-perl/t/022_type_coercion_datetime.t (original)
+++ trunk/libcoat-perl/t/022_type_coercion_datetime.t Sat Jul 5 11:07:28 2008
@@ -6,40 +6,30 @@
use Coat::Types;
use Coat::Meta::TypeConstraint;
-subtype 'DateTime'
+BEGIN { use_ok 'IO::File' }
+
+subtype 'IO::File'
=> as 'Object'
- => where {$_->isa('DateTime')};
+ => where {$_->isa('IO::File')};
-coerce 'DateTime'
+coerce 'IO::File'
=> from 'Str'
- => via {
- return DateTime->now()
- };
-
-subtype 'UInt'
- => as 'Int'
- => where { $_ >= 0}
- => message { 'Cette valeur ('.$_.') n\'est pas positive'};
+ => via {
+ IO::File->new
+ };
{
package A;
use Coat;
- has 'date_time' => (is => 'rw', isa => 'DateTime', coerce => 1);
- has 'uint' => (is =>'rw', isa => 'UInt');
+ has 'file' => (is => 'rw', isa => 'IO::File', coerce => 1);
}
-my $dt = DateTime->now();
-
my $a = A->new();
eval {
- $a->date_time('2008-10-12');
+ $a->file('foo.file');
};
-is($@,'','affectation ok');
+is($@,'','coercion succeeded');
-eval {
- $a->uint(23);
-};
-is($@,'','affectation ok');
-1;
+ok($a->file->isa('IO::File'), 'file is a IO::File object');
Modified: trunk/libcoat-perl/t/029_predicate_clearer.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcoat-perl/t/029_predicate_clearer.t?rev=22769&op=diff
==============================================================================
--- trunk/libcoat-perl/t/029_predicate_clearer.t (original)
+++ trunk/libcoat-perl/t/029_predicate_clearer.t Sat Jul 5 11:07:28 2008
@@ -35,11 +35,6 @@
$a->id(undef);
ok($a->has_id, "setting to undef means we still have a value");
-TODO: {
- local $TODO = "uhh what?";
- is($a->id, undef, "value is undef");
-};
-
$a->clear_id;
ok(!$a->has_id, "clearing from undef still makes predicate false");
is($a->id, undef, "value is still undef");
More information about the Pkg-perl-cvs-commits
mailing list