Hello community,
here is the log from the commit of package perl-Carp-Assert-More for
openSUSE:Factory checked in at 2013-06-06 15:10:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Carp-Assert-More (Old)
and /work/SRC/openSUSE:Factory/.perl-Carp-Assert-More.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Carp-Assert-More"
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Carp-Assert-More/perl-Carp-Assert-More.changes
2012-02-14 13:08:04.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Carp-Assert-More.new/perl-Carp-Assert-More.changes
2013-06-06 15:10:26.000000000 +0200
@@ -1,0 +2,16 @@
+Mon Jun 3 11:54:13 UTC 2013 - [email protected]
+
+- updated to 1.14
+ [ENHANCEMENTS]
+ Added assert_undefined() for Ben Hengst.
+
+ Added assert_unlike().
+
+ [FIXES]
+ assert_nonblank() wasn't using the correct message. Thanks to
+ Leland Johnson.
+
+ assert_nonempty() wouldn't work on blessed arrays and refs.
+ Now it will.
+
+-------------------------------------------------------------------
Old:
----
Carp-Assert-More-1.12.tar.gz
New:
----
Carp-Assert-More-1.14.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Carp-Assert-More.spec ++++++
--- /var/tmp/diff_new_pack.afTvyK/_old 2013-06-06 15:10:26.000000000 +0200
+++ /var/tmp/diff_new_pack.afTvyK/_new 2013-06-06 15:10:26.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-Carp-Assert-More
#
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -15,27 +15,25 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
+
Name: perl-Carp-Assert-More
-Version: 1.12
+Version: 1.14
Release: 0
%define cpan_name Carp-Assert-More
Summary: Convenience wrappers around Carp::Assert
-License: GPL-1.0+ or Artistic-1.0
+License: Artistic-2.0
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Carp-Assert-More/
-Source:
http://www.cpan.org/authors/id/P/PE/PETDANCE/Carp-Assert-More-%{version}.tar.gz
+Source:
http://www.cpan.org/authors/id/P/PE/PETDANCE/%{cpan_name}-%{version}.tar.gz
+BuildArch: noarch
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
-BuildRequires: perl(Carp)
BuildRequires: perl(Carp::Assert)
-BuildRequires: perl(Scalar::Util)
BuildRequires: perl(Test::Exception)
-Requires: perl(Carp)
+#BuildRequires: perl(Carp::Assert::More)
Requires: perl(Carp::Assert)
-Requires: perl(Scalar::Util)
Requires: perl(Test::Exception)
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildArch: noarch
%{perl_requires}
%description
@@ -72,11 +70,8 @@
%perl_process_packlist
%perl_gen_filelist
-%clean
-%{__rm} -rf %{buildroot}
-
%files -f %{name}.files
-%defattr(644,root,root,755)
+%defattr(-,root,root,755)
%doc Changes README
%changelog
++++++ Carp-Assert-More-1.12.tar.gz -> Carp-Assert-More-1.14.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/Changes
new/Carp-Assert-More-1.14/Changes
--- old/Carp-Assert-More-1.12/Changes 2005-10-14 18:59:42.000000000 +0200
+++ new/Carp-Assert-More-1.14/Changes 2012-10-31 17:37:08.000000000 +0100
@@ -1,6 +1,19 @@
Revision history for Perl extension Carp::Assert::More.
-1.12
+1.14 Wed Oct 31 11:37:04 CDT 2012
+ [ENHANCEMENTS]
+ Added assert_undefined() for Ben Hengst.
+
+ Added assert_unlike().
+
+ [FIXES]
+ assert_nonblank() wasn't using the correct message. Thanks to
+ Leland Johnson.
+
+ assert_nonempty() wouldn't work on blessed arrays and refs.
+ Now it will.
+
+1.12 Oct 14 2005
[ENHANCEMENTS]
* Added assert_nonnegative() and assert_nonnegative_integer().
* Added assert_lacks(). Thanks to Bob Diss.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/MANIFEST
new/Carp-Assert-More-1.14/MANIFEST
--- old/Carp-Assert-More-1.12/MANIFEST 2005-10-14 19:15:13.000000000 +0200
+++ new/Carp-Assert-More-1.14/MANIFEST 2012-10-31 17:37:25.000000000 +0100
@@ -28,7 +28,10 @@
t/assert_nonzero.t
t/assert_positive_integer.t
t/assert_positive.t
+t/assert_undefined.t
+t/assert_unlike.t
t/pod.t
t/pod-coverage.t
t/test-coverage.t
-META.yml Module meta-data (added by MakeMaker)
+META.yml Module YAML meta-data (added by
MakeMaker)
+META.json Module JSON meta-data (added by
MakeMaker)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/META.json
new/Carp-Assert-More-1.14/META.json
--- old/Carp-Assert-More-1.12/META.json 1970-01-01 01:00:00.000000000 +0100
+++ new/Carp-Assert-More-1.14/META.json 2012-10-31 17:37:25.000000000 +0100
@@ -0,0 +1,56 @@
+{
+ "abstract" : "unknown",
+ "author" : [
+ "unknown"
+ ],
+ "dynamic_config" : 1,
+ "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter
version 2.112621",
+ "license" : [
+ "artistic_2"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : "2"
+ },
+ "name" : "Carp-Assert-More",
+ "no_index" : {
+ "directory" : [
+ "t",
+ "inc"
+ ]
+ },
+ "prereqs" : {
+ "build" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : 0
+ }
+ },
+ "configure" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : 0
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "Carp" : 0,
+ "Carp::Assert" : 0,
+ "Scalar::Util" : 0,
+ "Test::Exception" : 0,
+ "Test::More" : "0.18"
+ }
+ }
+ },
+ "release_status" : "stable",
+ "resources" : {
+ "bugtracker" : {
+ "web" :
"https://rt.cpan.org/Public/Dist/Display.html?Name=Carp-Assert-More"
+ },
+ "license" : [
+ "http://www.opensource.org/licenses/artistic-license-2.0.php"
+ ],
+ "repository" : {
+ "url" : "http://github.com/petdance/carp-assert-more/tree/master"
+ }
+ },
+ "version" : "1.14"
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/META.yml
new/Carp-Assert-More-1.14/META.yml
--- old/Carp-Assert-More-1.12/META.yml 2005-10-14 19:15:13.000000000 +0200
+++ new/Carp-Assert-More-1.14/META.yml 2012-10-31 17:37:24.000000000 +0100
@@ -1,15 +1,30 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: Carp-Assert-More
-version: 1.12
-version_from: More.pm
-installdirs: site
+---
+abstract: unknown
+author:
+ - unknown
+build_requires:
+ ExtUtils::MakeMaker: 0
+configure_requires:
+ ExtUtils::MakeMaker: 0
+dynamic_config: 1
+generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version
2.112621'
+license: artistic_2
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+name: Carp-Assert-More
+no_index:
+ directory:
+ - t
+ - inc
requires:
- Carp: 0
- Carp::Assert: 0
- Scalar::Util: 0
- Test::Exception: 0
- Test::More: 0.18
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30
+ Carp: 0
+ Carp::Assert: 0
+ Scalar::Util: 0
+ Test::Exception: 0
+ Test::More: 0.18
+resources:
+ bugtracker:
https://rt.cpan.org/Public/Dist/Display.html?Name=Carp-Assert-More
+ license: http://www.opensource.org/licenses/artistic-license-2.0.php
+ repository: http://github.com/petdance/carp-assert-more/tree/master
+version: 1.14
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/Makefile.PL
new/Carp-Assert-More-1.14/Makefile.PL
--- old/Carp-Assert-More-1.12/Makefile.PL 2005-10-14 17:55:42.000000000
+0200
+++ new/Carp-Assert-More-1.14/Makefile.PL 2012-10-31 15:53:54.000000000
+0100
@@ -1,6 +1,12 @@
+package main;
+
+use 5.006001;
+
+use strict;
+use warnings;
use ExtUtils::MakeMaker;
-WriteMakefile(
+my %parms = (
NAME => 'Carp::Assert::More',
VERSION_FROM => 'More.pm', # finds $VERSION
@@ -11,9 +17,9 @@
PREREQ_PM => {
Carp => 0,
'Carp::Assert' => 0,
- 'Test::More' => 0.18,
'Scalar::Util' => 0,
- 'Test::Exception' => 0,
+ 'Test::Exception' => 0,
+ 'Test::More' => 0.18,
},
dist => {
@@ -22,3 +28,35 @@
DIST_DEFAULT => 'all tardist',
},
);
+
+if ( $ExtUtils::MakeMaker::VERSION =~ /^\d\.\d\d$/ and
$ExtUtils::MakeMaker::VERSION > 6.30 ) {
+ $parms{LICENSE} = 'artistic_2';
+}
+
+if ( $ExtUtils::MakeMaker::VERSION ge '6.46' ) {
+ $parms{META_MERGE} = {
+ resources => {
+ bugtracker =>
'https://rt.cpan.org/Public/Dist/Display.html?Name=Carp-Assert-More',
+ repository =>
'http://github.com/petdance/carp-assert-more/tree/master',
+ license =>
'http://www.opensource.org/licenses/artistic-license-2.0.php',
+ }
+ };
+}
+
+WriteMakefile( %parms );
+
+package MY;
+
+sub MY::postamble {
+ my $postamble = <<'MAKE_FRAG';
+.PHONY: critic
+
+critic:
+ perlcritic -1 -q -profile perlcriticrc More.pm t/*.t
+
+MAKE_FRAG
+
+ return $postamble;
+}
+
+1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/More.pm
new/Carp-Assert-More-1.14/More.pm
--- old/Carp-Assert-More-1.12/More.pm 2005-10-14 18:58:34.000000000 +0200
+++ new/Carp-Assert-More-1.14/More.pm 2012-10-31 17:19:28.000000000 +0100
@@ -16,12 +16,12 @@
=head1 VERSION
-Version 1.12
+Version 1.14
=cut
BEGIN {
- $VERSION = '1.12';
+ $VERSION = '1.14';
@ISA = qw(Exporter);
@EXPORT = qw(
assert_defined
@@ -47,11 +47,15 @@
assert_nonzero_integer
assert_positive
assert_positive_integer
+ assert_undefined
+ assert_unlike
);
}
=head1 SYNOPSIS
+A set of convenience functions for common assertions.
+
use Carp::Assert::More;
my $obj = My::Object;
@@ -132,6 +136,8 @@
Asserts that I<$string> matches I<qr/regex/>.
+The assertion fails either the string or the regex are undef.
+
=cut
sub assert_like($$;$) {
@@ -147,6 +153,29 @@
&Carp::confess( _fail_msg($name) );
}
+=head2 assert_unlike( $string, qr/regex/ [,$name] )
+
+Asserts that I<$string> matches I<qr/regex/>.
+
+The assertion fails if the regex is undef.
+
+=cut
+
+sub assert_unlike($$;$) {
+ my $string = shift;
+ my $regex = shift;
+ my $name = shift;
+
+ return if !defined($string);
+
+ assert_nonref( $string, $name );
+ assert_isa( $regex, 'Regexp', $name );
+ return if $string !~ $regex;
+
+ require Carp;
+ &Carp::confess( _fail_msg($name) );
+}
+
=head2 assert_defined( $this [, $name] )
Asserts that I<$this> is defined.
@@ -160,6 +189,19 @@
&Carp::confess( _fail_msg($_[1]) );
}
+=head2 assert_undefined( $this [, $name] )
+
+Asserts that I<$this> is not defined.
+
+=cut
+
+sub assert_undefined($;$) {
+ return unless defined( $_[0] );
+
+ require Carp;
+ &Carp::confess( _fail_msg($_[1]) );
+}
+
=head2 assert_nonblank( $this [, $name] )
Asserts that I<$this> is not blank and not a reference.
@@ -174,7 +216,7 @@
return if $this ne "";
require Carp;
- &Carp::confess( _fail_msg($_[1]) );
+ &Carp::confess( _fail_msg($name) );
}
=head1 NUMERIC ASSERTIONS
@@ -183,8 +225,9 @@
Asserts that I<$this> is an integer, which may be zero or negative.
- assert_integer( 0 ); # pass
- assert_integer( -14 ); # pass
+ assert_integer( 0 ); # pass
+ assert_integer( 14 ); # pass
+ assert_integer( -14 ); # FAIL
assert_integer( '14.' ); # FAIL
=cut
@@ -250,8 +293,8 @@
to zero. Since non-numeric strings evaluate to zero, this means that
any non-numeric string will pass.
- assert_nonnegative( 0 ); # pass
- assert_nonnegative( -14 ); # FAIL
+ assert_nonnegative( 0 ); # pass
+ assert_nonnegative( -14 ); # FAIL
assert_nonnegative( '14.' ); # pass
assert_nonnegative( 'dog' ); # pass
@@ -294,8 +337,8 @@
Asserts that the numeric value of I<$this> is not zero, and that I<$this>
is an integer.
- assert_nonzero_integer( 0 ); # FAIL
- assert_nonzero_integer( -14 ); # pass
+ assert_nonzero_integer( 0 ); # FAIL
+ assert_nonzero_integer( -14 ); # pass
assert_nonzero_integer( '14.' ); # FAIL
=cut
@@ -333,8 +376,8 @@
Asserts that the numeric value of I<$this> is not less than zero, and
that I<$this> is an integer.
- assert_nonnegative_integer( 0 ); # pass
- assert_nonnegative_integer( -14 ); # pass
+ assert_nonnegative_integer( 0 ); # pass
+ assert_nonnegative_integer( -14 ); # pass
assert_nonnegative_integer( '14.' ); # FAIL
=cut
@@ -352,8 +395,8 @@
Asserts that the numeric value of I<$this> is less than zero, and that
I<$this> is an integer.
- assert_negative_integer( 0 ); # FAIL
- assert_negative_integer( -14 ); # pass
+ assert_negative_integer( 0 ); # FAIL
+ assert_negative_integer( -14 ); # pass
assert_negative_integer( '14.' ); # FAIL
=cut
@@ -418,15 +461,24 @@
my $ref = shift;
my $name = shift;
- my $type = ref $ref;
- if ( $type eq "HASH" ) {
- assert_positive( scalar keys %$ref, $name );
+ require Scalar::Util;
+
+ my $underlying_type;
+ if ( Scalar::Util::blessed( $ref ) ) {
+ $underlying_type = Scalar::Util::reftype( $ref );
}
- elsif ( $type eq "ARRAY" ) {
- assert_positive( scalar @$ref, $name );
+ else {
+ $underlying_type = ref( $ref );
+ }
+
+ if ( $underlying_type eq 'HASH' ) {
+ assert_positive( scalar keys %{$ref}, $name );
+ }
+ elsif ( $underlying_type eq 'ARRAY' ) {
+ assert_positive( scalar @{$ref}, $name );
}
else {
- assert_fail( "Not an array or hash reference" );
+ assert_fail( 'Not an array or hash reference' );
}
}
@@ -593,11 +645,12 @@
}
-=head1 COPYRIGHT
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2005-2012 Andy Lester.
-Copyright (c) 2005 Andy Lester. All rights reserved. This program is
-free software; you can redistribute it and/or modify it under the same
-terms as Perl itself.
+This program is free software; you can redistribute it and/or modify
+it under the terms of the Artistic License version 2.0.
=head1 ACKNOWLEDGEMENTS
@@ -606,7 +659,9 @@
Pete Krawczyk,
David Storrs,
Dan Friedman,
-and Allard Hoeve
+Allard Hoeve,
+Thomas L. Shinnick,
+and Leland Johnson
for code and fixes.
=cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/README
new/Carp-Assert-More-1.14/README
--- old/Carp-Assert-More-1.12/README 2005-10-14 17:55:42.000000000 +0200
+++ new/Carp-Assert-More-1.14/README 2012-10-31 14:51:23.000000000 +0100
@@ -1,11 +1,11 @@
-NAME
- Carp::Assert::More - Convenience functions for Carp::Assert
+# Carp::Assert::More
-SYNOPSIS
- Coming
+Carp::Assert::More is a set of handy assertion functions for Perl.
-DESCRIPTION
- Coming
+For example, instead of writing
-AUTHOR
- Andy Lester <[email protected]>
+ assert( $foo ne '', '$foo cannot be blank' );
+
+you can write
+
+ assert_nonblank( $foo, '$foo cannot be blank' );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/00-load.t
new/Carp-Assert-More-1.14/t/00-load.t
--- old/Carp-Assert-More-1.12/t/00-load.t 2005-10-14 19:02:46.000000000
+0200
+++ new/Carp-Assert-More-1.14/t/00-load.t 2012-10-31 15:00:35.000000000
+0100
@@ -2,8 +2,8 @@
use Test::More tests => 1;
-BEGIN {
- use_ok( 'Carp::Assert::More' );
-}
+use Carp::Assert::More;
-diag( "Testing Carp::Assert::More $Carp::Assert::More::VERSION under Perl $]
and Test::More $Test::More::VERSION" );
+diag( "Testing Carp::Assert::More $Carp::Assert::More::VERSION, Test::More
$Test::More::VERSION, Perl $], $^X" );
+
+pass( 'Module loaded' );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_defined.t
new/Carp-Assert-More-1.14/t/assert_defined.t
--- old/Carp-Assert-More-1.12/t/assert_defined.t 2005-10-14
19:02:35.000000000 +0200
+++ new/Carp-Assert-More-1.14/t/assert_defined.t 2012-10-31
17:28:40.000000000 +0100
@@ -1,34 +1,15 @@
-#!perl -Tw
+#!perl -T
use warnings;
use strict;
-use Test::More tests => 5;
+use Test::More tests => 4;
-BEGIN { use_ok( 'Carp::Assert::More' ); }
+use Carp::Assert::More;
-local $@;
-$@ = '';
+use Test::Exception;
-# 3 is defined
-eval {
- assert_defined( 3 );
-};
-is( $@, '' );
-
-# 0 is defined (false, but defined)
-eval {
- assert_defined( 0 );
-};
-is( $@, '' );
-
-# '' is defined (false, but defined)
-eval {
- assert_defined( 0 );
-};
-is( $@, '' );
-
-eval {
- assert_defined( undef );
-};
-like( $@, qr/Assertion.*failed/ );
+lives_ok( sub { assert_defined( 3 ); }, '3 is defined' );
+lives_ok( sub { assert_defined( 0 ); }, '0 is false but defined' );
+lives_ok( sub { assert_defined( '' ); }, 'blank is false but defined' );
+throws_ok( sub { assert_defined( undef, 'Flargle' ); }, qr/\QAssertion
(Flargle) failed!/, 'undef is not defined' );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_exists.t
new/Carp-Assert-More-1.14/t/assert_exists.t
--- old/Carp-Assert-More-1.12/t/assert_exists.t 2005-10-14 19:02:35.000000000
+0200
+++ new/Carp-Assert-More-1.14/t/assert_exists.t 2012-10-31 17:29:03.000000000
+0100
@@ -1,4 +1,4 @@
-#!perl -Tw
+#!perl -T
use warnings;
use strict;
@@ -10,8 +10,8 @@
}
my %foo = (
- name => "Andy Lester",
- phone => "578-3338",
+ name => 'Andy Lester',
+ phone => '578-3338',
wango => undef,
);
@@ -19,13 +19,13 @@
eval {
assert_exists( \%foo, 'name' );
};
-is( $@, "" );
+is( $@, '' );
eval {
assert_exists( \%foo, 'wango' );
};
-is( $@, "" );
+is( $@, '' );
eval {
@@ -37,7 +37,7 @@
eval {
assert_exists( \%foo, [qw( name )] );
};
-is( $@, "" );
+is( $@, '' );
eval {
assert_exists( \%foo, [qw( name social-security-number )] );
@@ -47,12 +47,10 @@
eval {
assert_exists( \%foo, [qw( name phone )] );
};
-is( $@, "" );
+is( $@, '' );
eval {
assert_exists( \%foo, ['name','Nonexistent'] );
};
like( $@, qr/Assert.+failed/ );
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_hashref.t
new/Carp-Assert-More-1.14/t/assert_hashref.t
--- old/Carp-Assert-More-1.12/t/assert_hashref.t 2005-10-14
19:02:35.000000000 +0200
+++ new/Carp-Assert-More-1.14/t/assert_hashref.t 2012-10-31
17:29:23.000000000 +0100
@@ -9,9 +9,9 @@
use warnings;
use strict;
-use Test::More tests => 7;
+use Test::More tests => 6;
-BEGIN { use_ok( 'Carp::Assert::More' ); }
+use Carp::Assert::More;
local $@;
$@ = '';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_in.t
new/Carp-Assert-More-1.14/t/assert_in.t
--- old/Carp-Assert-More-1.12/t/assert_in.t 2005-10-14 19:02:35.000000000
+0200
+++ new/Carp-Assert-More-1.14/t/assert_in.t 2012-10-31 17:33:51.000000000
+0100
@@ -3,9 +3,9 @@
use warnings;
use strict;
-use Test::More tests => 10;
+use Test::More tests => 9;
-BEGIN { use_ok( 'Carp::Assert::More' ); }
+use Carp::Assert::More;
local $@;
$@ = '';
@@ -35,7 +35,7 @@
eval {
my $string = 'tres';
my $ref = [ 'uno', 'dos', 'tres', 'quatro' ];
- assert_in( $string, $ref );
+ assert_in( $string, $ref );
};
is( $@, '' );
@@ -59,14 +59,14 @@
# undef for the arrayref fails
eval {
- my $string = "zippo";
+ my $string = 'zippo';
assert_in( $string, undef );
};
like( $@, qr/Assertion.*failed/ );
# A bad reference should also fail.
eval {
- my $string = "nil";
+ my $string = 'nil';
my $ref = \$string;
assert_in( $string, $ref );
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_integer.t
new/Carp-Assert-More-1.14/t/assert_integer.t
--- old/Carp-Assert-More-1.12/t/assert_integer.t 2005-10-14
19:02:35.000000000 +0200
+++ new/Carp-Assert-More-1.14/t/assert_integer.t 2012-10-31
17:35:12.000000000 +0100
@@ -3,9 +3,11 @@
use warnings;
use strict;
-use Test::More tests=>7;
+use Test::More tests => 6;
-BEGIN { use_ok( 'Carp::Assert::More' ); }
+use Carp::Assert::More;
+
+use Test::Exception;
use constant PASS => 1;
use constant FAIL => 2;
@@ -15,8 +17,8 @@
[ 0, PASS ],
[ 0.4, FAIL ],
[ -10, PASS ],
- [ "dog", FAIL ],
- [ "14.", FAIL ],
+ [ 'dog', FAIL ],
+ [ '14.', FAIL ],
);
for my $case ( @cases ) {
@@ -26,9 +28,9 @@
eval { assert_integer( $val ) };
if ( $status eq FAIL ) {
- like( $@, qr/Assertion.+failed/, $desc );
- } else {
- is( $@, "", $desc );
+ throws_ok( sub { assert_integer( $val ) }, qr/Assertion.+failed/,
$desc );
+ }
+ else {
+ lives_ok( sub { assert_integer( $val ) }, $desc );
}
}
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_is.t
new/Carp-Assert-More-1.14/t/assert_is.t
--- old/Carp-Assert-More-1.12/t/assert_is.t 2005-10-14 19:02:35.000000000
+0200
+++ new/Carp-Assert-More-1.14/t/assert_is.t 2012-10-31 17:31:16.000000000
+0100
@@ -3,17 +3,18 @@
use warnings;
use strict;
-use Test::More tests => 9;
-use Test::Exception;
+use Test::More tests => 8;
+
+use Carp::Assert::More;
-BEGIN { use_ok( 'Carp::Assert::More' ); }
+use Test::Exception;
-throws_ok { assert_is( 4, 3 ) } qr/Assertion.*failed/, "4 is not 3";
-throws_ok { assert_is( undef, "" ) } qr/Assertion.*failed/, "Undef is not
space";
-throws_ok { assert_is( "", undef ) } qr/Assertion.*failed/, "Space is not
undef";
+throws_ok { assert_is( 4, 3 ) } qr/Assertion.*failed/, "4 is not 3";
+throws_ok { assert_is( undef, "" ) } qr/Assertion.*failed/, "Undef is not
space";
+throws_ok { assert_is( "", undef ) } qr/Assertion.*failed/, "Space is not
undef";
lives_ok { assert_is( undef, undef ) } "Undef only matches undef";
-lives_ok { assert_is( "a", "a" ) } "a is a";
-lives_ok { assert_is( 4, 4 ) } "4 is 4";
-lives_ok { assert_is( "", "" ) } "space is space";
-lives_ok { assert_is( "14", 14 ) } "14 is 14 as strings";
+lives_ok { assert_is( "a", "a" ) } "a is a";
+lives_ok { assert_is( 4, 4 ) } "4 is 4";
+lives_ok { assert_is( "", "" ) } "space is space";
+lives_ok { assert_is( "14", 14 ) } "14 is 14 as strings";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_isa.t
new/Carp-Assert-More-1.14/t/assert_isa.t
--- old/Carp-Assert-More-1.12/t/assert_isa.t 2005-10-14 19:02:35.000000000
+0200
+++ new/Carp-Assert-More-1.14/t/assert_isa.t 2012-10-31 17:30:05.000000000
+0100
@@ -3,10 +3,10 @@
use warnings;
use strict;
-use Test::More tests => 5;
-use IO::File; # just for creating objects
+use Test::More tests => 4;
+use Carp::Assert::More;
-BEGIN { use_ok( 'Carp::Assert::More' ); }
+use IO::File; # just for creating objects
local $@;
$@ = '';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_isnt.t
new/Carp-Assert-More-1.14/t/assert_isnt.t
--- old/Carp-Assert-More-1.12/t/assert_isnt.t 2005-10-14 19:02:35.000000000
+0200
+++ new/Carp-Assert-More-1.14/t/assert_isnt.t 2012-10-31 17:30:54.000000000
+0100
@@ -3,17 +3,18 @@
use warnings;
use strict;
-use Test::More tests => 9;
-use Test::Exception;
+use Test::More tests => 8;
+
+use Carp::Assert::More;
-BEGIN { use_ok( 'Carp::Assert::More' ); }
+use Test::Exception;
-lives_ok { assert_isnt( 4, 3 ) } "4 is not 3";
-lives_ok { assert_isnt( undef, "" ) } "Undef is not space";
-lives_ok { assert_isnt( "", undef ) } "Space is not undef";
+lives_ok { assert_isnt( 4, 3 ) } "4 is not 3";
+lives_ok { assert_isnt( undef, "" ) } "Undef is not space";
+lives_ok { assert_isnt( "", undef ) } "Space is not undef";
-throws_ok { assert_isnt( undef, undef ) } qr/Assertion.+failed/, "Undef
only matches undef";
-throws_ok { assert_isnt( "a", "a" ) } qr/Assertion.+failed/, "a is
a";
-throws_ok { assert_isnt( 4, 4 ) } qr/Assertion.+failed/, "4 is
4";
-throws_ok { assert_isnt( "", "" ) } qr/Assertion.+failed/, "space
is space";
-throws_ok { assert_isnt( "14", 14 ) } qr/Assertion.+failed/, "14 is
14 as strings";
+throws_ok { assert_isnt( undef, undef ) } qr/Assertion.+failed/, "Undef
only matches undef";
+throws_ok { assert_isnt( "a", "a" ) } qr/Assertion.+failed/, "a is
a";
+throws_ok { assert_isnt( 4, 4 ) } qr/Assertion.+failed/, "4 is
4";
+throws_ok { assert_isnt( "", "" ) } qr/Assertion.+failed/, "space
is space";
+throws_ok { assert_isnt( "14", 14 ) } qr/Assertion.+failed/, "14 is
14 as strings";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_lacks.t
new/Carp-Assert-More-1.14/t/assert_lacks.t
--- old/Carp-Assert-More-1.12/t/assert_lacks.t 2005-10-14 19:07:02.000000000
+0200
+++ new/Carp-Assert-More-1.14/t/assert_lacks.t 2012-10-31 17:33:12.000000000
+0100
@@ -3,48 +3,23 @@
use warnings;
use strict;
-use Test::More tests=>7;
+use Test::More tests => 6;
-BEGIN {
- use_ok( 'Carp::Assert::More' );
-}
+use Carp::Assert::More;
+
+use Test::Exception;
my %foo = (
- name => "Andy Lester",
- phone => "578-3338",
+ name => 'Andy Lester',
+ phone => '578-3338',
wango => undef,
);
-eval {
- assert_lacks( \%foo, 'Name' );
-};
-is( $@, "" );
-
-
-eval {
- assert_lacks( \%foo, 'name' );
-};
-like( $@, qr/Assert.+failed/ );
-
-
-eval {
- assert_lacks( \%foo, [qw( Wango )] );
-};
-is( $@, "" );
-
-eval {
- assert_lacks( \%foo, [qw( Wango Tango )] );
-};
-is( $@, "" );
-
-eval {
- assert_lacks( \%foo, [qw( Wango Tango name )] );
-};
-like( $@, qr/Assertion.+failed/ );
-
-eval {
- assert_lacks( \%foo, [qw()] );
-};
-is( $@, "" );
+lives_ok( sub { assert_lacks( \%foo, 'Name' ) } );
+throws_ok( sub { assert_lacks( \%foo, 'name' ); }, qr/Assert.+failed/ );
+lives_ok( sub { assert_lacks( \%foo, [qw( Wango )] ); } );
+lives_ok( sub { assert_lacks( \%foo, [qw( Wango Tango )] ); } );
+throws_ok( sub { assert_lacks( \%foo, [qw( Wango Tango name )] ); },
qr/Assertion.+failed/ );
+lives_ok( sub { assert_lacks( \%foo, [qw()] ) } );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_like.t
new/Carp-Assert-More-1.14/t/assert_like.t
--- old/Carp-Assert-More-1.12/t/assert_like.t 2005-10-14 19:02:35.000000000
+0200
+++ new/Carp-Assert-More-1.14/t/assert_like.t 2012-10-31 17:33:14.000000000
+0100
@@ -3,57 +3,20 @@
use warnings;
use strict;
-use Test::More tests => 8;
+use Test::More tests => 7;
-BEGIN { use_ok( 'Carp::Assert::More' ); }
+use Test::Exception;
-local $@;
-$@ = '';
+use Carp::Assert::More;
-# 'like' is in 'unlikely'
-eval {
- assert_like('unlikely', qr/like/ );
-};
-is( $@, '' );
-
-# 'te.*st' matches 'tempest'
-eval {
- my $string = 'tempest';
- assert_like( $string, qr/te.*st/ );
-};
-is( $@, '' );
-
-# 'qu.*inn' matches 'quality inn'
-eval {
- my $string = 'quality inn';
- my $regex = qr/qu.*inn/;
- assert_like( $string, $regex );
-};
-is( $@, '' );
-
-# 'fa.*il' does not match 'passing'
-eval {
- assert_like( 'passing', qr/fa.*il/ );
-};
-like( $@, qr/Assertion.*failed/ );
-
-# undef with a regex will fail
-eval {
- assert_like( undef, qr/fails/ );
-};
-like( $@, qr/Assertion.*failed/ );
-
-# A string without a regex fails, too
-eval {
- my $string = "Blah blah";
- assert_like( $string, undef );
-};
-like( $@, qr/Assertion.*failed/ );
-
-# A bad reference should also fail.
-eval {
- my $string = "Blah blah";
- my $ref = \$string;
- assert_like( $string, $ref );
-};
-like( $@, qr/Assertion.*failed/ );
+lives_ok( sub { assert_like('unlikely', qr/like/ ); } );
+lives_ok( sub { assert_like( 'tempest', qr/te.*st/ ); } );
+lives_ok( sub { assert_like( 'quality inn', qr/qu.*inn/ ); } );
+throws_ok( sub { assert_like( 'passing', qr/fa.*il/, 'Flargle' ); },
qr/\QAssertion (Flargle) failed!/ );
+throws_ok( sub { assert_like( undef, qr/anything/, 'Bongo' ); },
qr/\QAssertion (Bongo) failed!/, 'undef string always fails' );
+throws_ok( sub { assert_like( 'Blah blah', undef, 'Bingo' ); }, qr/\QAssertion
(Bingo) failed!/, 'undef regex always fails' );
+throws_ok( sub {
+ my $string = 'Blah blah';
+ my $ref = \$string;
+ assert_like( $string, $ref, 'Dingo' );
+}, qr/\QAssertion (Dingo) failed/, 'bad reference fails' );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_listref.t
new/Carp-Assert-More-1.14/t/assert_listref.t
--- old/Carp-Assert-More-1.12/t/assert_listref.t 2005-10-14
19:02:35.000000000 +0200
+++ new/Carp-Assert-More-1.14/t/assert_listref.t 2012-10-31
17:33:24.000000000 +0100
@@ -9,9 +9,9 @@
use warnings;
use strict;
-use Test::More tests => 8;
+use Test::More tests => 7;
-BEGIN { use_ok( 'Carp::Assert::More' ); }
+use Carp::Assert::More;
local $@;
$@ = '';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_nonblank.t
new/Carp-Assert-More-1.14/t/assert_nonblank.t
--- old/Carp-Assert-More-1.12/t/assert_nonblank.t 2005-10-14
19:02:35.000000000 +0200
+++ new/Carp-Assert-More-1.14/t/assert_nonblank.t 2012-10-31
15:12:05.000000000 +0100
@@ -3,41 +3,23 @@
use warnings;
use strict;
-use Test::More tests => 6;
+use Test::More tests => 7;
-BEGIN { use_ok( 'Carp::Assert::More' ); }
+use Test::Exception;
-local $@;
-$@ = '';
+use Carp::Assert::More;
-# 3 is nonblank
-eval {
- assert_nonblank( 3 );
-};
-is( $@, '' );
-
-# 0 is nonblank
-eval {
- assert_nonblank( 0 );
-};
-is( $@, '' );
-
-# '' is blank
-eval {
- assert_nonblank( '' );
-};
-like( $@, qr/Assertion.*failed/ );
-
-# undef is not nonblank
-eval {
- assert_nonblank( undef );
-};
-like( $@, qr/Assertion.*failed/ );
+lives_ok( sub { assert_nonblank( 3 ) } );
+lives_ok( sub { assert_nonblank( 0 ) } );
-# References are not nonblank
-eval {
+throws_ok( sub { assert_nonblank( '' ) }, qr/Assertion failed!/, q{'' is
blank, with no message} );
+throws_ok( sub { assert_nonblank( '', 'flooble' ) }, qr/\QAssertion (flooble)
failed!/, q{'' is blank, with message} );
+
+throws_ok( sub { assert_nonblank( undef ) }, qr/Assertion failed!/, q{undef is
blank, with no message} );
+throws_ok( sub { assert_nonblank( undef, 'bargle' ) }, qr/\QAssertion (bargle)
failed!/, q{undef is blank, with message} );
+
+throws_ok( sub {
my $scalar = "Blah blah";
my $ref = \$scalar;
- assert_nonblank( $ref );
-};
-like( $@, qr/Assertion.*failed/ );
+ assert_nonblank( $ref, 'wango' );
+}, qr/\QAssertion (wango) failed!/, 'Testing scalar ref' );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_nonempty.t
new/Carp-Assert-More-1.14/t/assert_nonempty.t
--- old/Carp-Assert-More-1.12/t/assert_nonempty.t 2005-10-14
19:02:35.000000000 +0200
+++ new/Carp-Assert-More-1.14/t/assert_nonempty.t 2012-10-31
15:43:07.000000000 +0100
@@ -3,17 +3,14 @@
use warnings;
use strict;
-use Test::More tests => 8;
+use Test::More tests => 12;
+use Test::Exception;
-BEGIN {
- use_ok( 'Carp::Assert::More' );
-}
+use Carp::Assert::More;
use constant PASS => 1;
use constant FAIL => 0;
-my $array_object = bless( [], 'WackyPackage' );
-
my @cases = (
[ 0 => FAIL ],
[ 'foo' => FAIL ],
@@ -38,3 +35,20 @@
}
}
+throws_ok( sub { assert_nonempty( 27 ) }, qr/Not an array or hash reference/ );
+
+BLESSED_ARRAY: {
+ my $array_object = bless( [], 'WackyPackage' );
+ throws_ok( sub { assert_nonempty( $array_object, 'Flooble' ) },
qr/\QAssertion (Flooble) failed!/ );
+
+ push( @{$array_object}, 14 );
+ lives_ok( sub { assert_nonempty( $array_object ) } );
+}
+
+BLESSED_HASH: {
+ my $hash_object = bless( {}, 'WackyPackage' );
+ throws_ok( sub { assert_nonempty( $hash_object, 'Flargle' ) },
qr/\QAssertion (Flargle) failed!/ );
+
+ $hash_object->{foo} = 14;
+ lives_ok( sub { assert_nonempty( $hash_object ) } );
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_positive.t
new/Carp-Assert-More-1.14/t/assert_positive.t
--- old/Carp-Assert-More-1.12/t/assert_positive.t 2005-10-14
19:02:35.000000000 +0200
+++ new/Carp-Assert-More-1.14/t/assert_positive.t 2012-10-31
17:28:33.000000000 +0100
@@ -15,8 +15,8 @@
[ 0, FAIL ],
[ 0.4, PASS ],
[ -10, FAIL ],
- [ "dog", FAIL ],
- [ "14.", PASS ],
+ [ 'dog', FAIL ],
+ [ '14.', PASS ],
);
for my $case ( @cases ) {
@@ -27,8 +27,9 @@
if ( $status eq FAIL ) {
like( $@, qr/Assertion.+failed/, $desc );
- } else {
- is( $@, "", $desc );
+ }
+ else {
+ is( $@, '', $desc );
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_undefined.t
new/Carp-Assert-More-1.14/t/assert_undefined.t
--- old/Carp-Assert-More-1.12/t/assert_undefined.t 1970-01-01
01:00:00.000000000 +0100
+++ new/Carp-Assert-More-1.14/t/assert_undefined.t 2012-10-31
16:38:11.000000000 +0100
@@ -0,0 +1,15 @@
+#!perl -T
+
+use warnings;
+use strict;
+
+use Test::More tests => 4;
+
+use Carp::Assert::More;
+
+use Test::Exception;
+
+throws_ok( sub { assert_undefined( 3, 'Fleegle' ); }, qr/\QAssertion (Fleegle)
failed!/, '3 is defined' );
+throws_ok( sub { assert_undefined( 0, 'Drooper' ); }, qr/\QAssertion (Drooper)
failed!/, '0 is defined' );
+throws_ok( sub { assert_undefined( '', 'Snork' ); }, qr/\QAssertion (Snork)
failed!/, 'blank is defined' );
+lives_ok( sub { assert_undefined( undef ); }, '0 is undefined' );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/assert_unlike.t
new/Carp-Assert-More-1.14/t/assert_unlike.t
--- old/Carp-Assert-More-1.12/t/assert_unlike.t 1970-01-01 01:00:00.000000000
+0100
+++ new/Carp-Assert-More-1.14/t/assert_unlike.t 2012-10-31 16:54:11.000000000
+0100
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+use Test::More tests => 6;
+
+use Test::Exception;
+
+use Carp::Assert::More;
+
+throws_ok( sub { assert_unlike( 'unlikely', qr/like/, 'Wango' ); },
qr/\QAssertion (Wango) failed!/, 'Testing simple matching' );
+throws_ok( sub { assert_unlike( 'tempest', qr/te.*st/, 'Tango' ); },
qr/\QAssertion (Tango) failed!/, 'Testing simple matching' );
+lives_ok( sub { assert_unlike( 'passing', qr/fa.*il/, 'Flargle' ); }, 'Simple
non-matching' );
+lives_ok( sub { assert_unlike( undef, qr/anything/ ); }, 'undef string is
always unlike' );
+throws_ok( sub { assert_unlike( 'Blah blah', undef, 'Bingo' ); },
qr/\QAssertion (Bingo) failed!/, 'undef regex always fails' );
+throws_ok( sub {
+ my $string = 'Blah blah';
+ my $ref = \$string;
+ assert_unlike( $string, $ref, 'Dingo' );
+}, qr/\QAssertion (Dingo) failed/, 'bad reference fails' );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/pod-coverage.t
new/Carp-Assert-More-1.14/t/pod-coverage.t
--- old/Carp-Assert-More-1.12/t/pod-coverage.t 2005-10-14 19:02:35.000000000
+0200
+++ new/Carp-Assert-More-1.14/t/pod-coverage.t 2012-10-31 15:55:57.000000000
+0100
@@ -1,6 +1,15 @@
-#!perl -Tw
+#!perl -T
+
+use strict;
+use warnings;
use Test::More;
-eval "use Test::Pod::Coverage 1.04";
-plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage"
if $@;
-all_pod_coverage_ok();
+
+my $module = 'Test::Pod::Coverage 1.04';
+
+if ( eval "use $module; 1;" ) { ## no critic (ProhibitStringyEval)
+ all_pod_coverage_ok();
+}
+else {
+ plan skip_all => "$module required for testing POD";
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/pod.t
new/Carp-Assert-More-1.14/t/pod.t
--- old/Carp-Assert-More-1.12/t/pod.t 2005-10-14 19:02:35.000000000 +0200
+++ new/Carp-Assert-More-1.14/t/pod.t 2012-10-31 15:56:12.000000000 +0100
@@ -1,6 +1,15 @@
-#!perl -Tw
+#!perl -T
+
+use strict;
+use warnings;
use Test::More;
-eval "use Test::Pod 1.14";
-plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
-all_pod_files_ok();
+
+my $module = 'Test::Pod 1.14';
+
+if ( eval "use $module; 1;" ) { ## no critic (ProhibitStringyEval)
+ all_pod_files_ok();
+}
+else {
+ plan skip_all => "$module required for testing POD";
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.12/t/test-coverage.t
new/Carp-Assert-More-1.14/t/test-coverage.t
--- old/Carp-Assert-More-1.12/t/test-coverage.t 2005-10-14 19:02:53.000000000
+0200
+++ new/Carp-Assert-More-1.14/t/test-coverage.t 2012-10-31 16:52:33.000000000
+0100
@@ -1,10 +1,8 @@
#!perl -Tw
-use Test::More tests => 25;
+use Test::More tests => 26;
-BEGIN {
- use_ok( 'Carp::Assert::More' );
-}
+use Carp::Assert::More;
my @funcs = ( @Carp::Assert::More::EXPORT, @Carp::Assert::More::EXPORT_OK );
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]