[libmoosex-has-sugar-perl] 08/11: Improve Saccharin coverage

Intrigeri intrigeri at moszumanska.debian.org
Wed Aug 27 21:35:37 UTC 2014


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to annotated tag 1.000002-source
in repository libmoosex-has-sugar-perl.

commit c70dc98a6413250424a484359d94837099c6191b
Author: Kent Fredric <kentfredric at gmail.com>
Date:   Thu Jun 26 09:57:17 2014 +1200

    Improve Saccharin coverage
---
 t/10_saccharin.t                  | 7 ++++++-
 t/lib/T10Saccharin/TestPackage.pm | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/t/10_saccharin.t b/t/10_saccharin.t
index 3aebf9b..19aea69 100644
--- a/t/10_saccharin.t
+++ b/t/10_saccharin.t
@@ -28,7 +28,7 @@ use lib "t/lib";
 use T10Saccharin::TestPackage;
 
 sub cr {
-  return T10Saccharin::TestPackage->new( roattr => 'y', rwattr => 'y' );
+  return T10Saccharin::TestPackage->new( roattr => 'y', MONSTER => 'y', bareattr => 'z' );
 }
 
 pass("Syntax Compiles");
@@ -44,4 +44,9 @@ isnt( exception { $i->roattr('x') }, undef, "RO works still" );
 is( exception { $i->rwattr('x') }, undef, 'RW works still' );
 
 is( $i->rwattr(), 'x', "RW Works as expected" );
+
+isnt( exception { $i->bareattr() }, undef, "Bare has no accessors still" );
+
+is( $i->lazyroattr(), '1', "lazy ro default works as expected" );
+
 done_testing;
diff --git a/t/lib/T10Saccharin/TestPackage.pm b/t/lib/T10Saccharin/TestPackage.pm
index 08482a3..ace670b 100644
--- a/t/lib/T10Saccharin/TestPackage.pm
+++ b/t/lib/T10Saccharin/TestPackage.pm
@@ -10,7 +10,12 @@ use namespace::clean -except => 'meta';
 
 has roattr => required ro Str;
 
-has rwattr => required rw Str;
+has rwattr => required rw Str, init_arg "MONSTER";
+
+has bareattr => required bare Str;
+
+has lazyroattr => lazy ro Str, default { 1 }
+,;
 
 __PACKAGE__->meta->make_immutable;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmoosex-has-sugar-perl.git



More information about the Pkg-perl-cvs-commits mailing list