r72708 - in /trunk/libtest-differences-perl: ./ debian/ lib/Test/ t/
periapt-guest at users.alioth.debian.org
periapt-guest at users.alioth.debian.org
Sun Apr 17 20:10:27 UTC 2011
Author: periapt-guest
Date: Sun Apr 17 20:09:41 2011
New Revision: 72708
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=72708
Log:
* Added myself to Uploaders
* New upstream release
Added:
trunk/libtest-differences-perl/t/example.t
- copied unchanged from r72706, branches/upstream/libtest-differences-perl/current/t/example.t
trunk/libtest-differences-perl/t/flatten.t
- copied unchanged from r72706, branches/upstream/libtest-differences-perl/current/t/flatten.t
trunk/libtest-differences-perl/t/pass.t
- copied unchanged from r72706, branches/upstream/libtest-differences-perl/current/t/pass.t
trunk/libtest-differences-perl/t/struct.t
- copied unchanged from r72706, branches/upstream/libtest-differences-perl/current/t/struct.t
trunk/libtest-differences-perl/t/test.t
- copied unchanged from r72706, branches/upstream/libtest-differences-perl/current/t/test.t
trunk/libtest-differences-perl/t/text_vs_data.t
- copied unchanged from r72706, branches/upstream/libtest-differences-perl/current/t/text_vs_data.t
trunk/libtest-differences-perl/t/undef.t
- copied unchanged from r72706, branches/upstream/libtest-differences-perl/current/t/undef.t
Removed:
trunk/libtest-differences-perl/t/00flatten.t
trunk/libtest-differences-perl/t/01text_vs_data.t
trunk/libtest-differences-perl/t/02pass.t
trunk/libtest-differences-perl/t/03struct.t
trunk/libtest-differences-perl/t/10test.t
trunk/libtest-differences-perl/t/99example.t
Modified:
trunk/libtest-differences-perl/Build.PL
trunk/libtest-differences-perl/Changes
trunk/libtest-differences-perl/MANIFEST
trunk/libtest-differences-perl/META.yml
trunk/libtest-differences-perl/Makefile.PL
trunk/libtest-differences-perl/debian/changelog
trunk/libtest-differences-perl/debian/control
trunk/libtest-differences-perl/lib/Test/Differences.pm
Modified: trunk/libtest-differences-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-differences-perl/Build.PL?rev=72708&op=diff
==============================================================================
--- trunk/libtest-differences-perl/Build.PL (original)
+++ trunk/libtest-differences-perl/Build.PL Sun Apr 17 20:09:41 2011
@@ -3,16 +3,21 @@
use Module::Build;
my $builder = Module::Build->new(
- module_name => 'Test::Differences',
- license => 'perl',
- dist_author => 'Curtis "Ovid" Poe <ovid at cpan.org>',
- dist_version_from => 'lib/Test/Differences.pm',
- perl => 5.006,
- requires => {
- 'Test::More' => 0,
- 'Text::Diff' => 0.35,
+ module_name => 'Test::Differences',
+ license => 'perl',
+ dist_author => 'Curtis "Ovid" Poe <ovid at cpan.org>',
+ dist_version_from => 'lib/Test/Differences.pm',
+ perl => 5.006,
+ requires => {
+ 'Test::More' => 0,
+ 'Text::Diff' => 0.35,
+ 'Data::Dumper' => 2.126,
},
- add_to_cleanup => [ 'Test-Differences-*' ],
+ add_to_cleanup => ['Test-Differences-*'],
+ meta_merge => {
+ resources =>
+ { repository => 'https://github.com/Ovid/Test-Differences' }
+ },
);
$builder->create_build_script();
Modified: trunk/libtest-differences-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-differences-perl/Changes?rev=72708&op=diff
==============================================================================
--- trunk/libtest-differences-perl/Changes (original)
+++ trunk/libtest-differences-perl/Changes Sun Apr 17 20:09:41 2011
@@ -1,4 +1,15 @@
Changes file for Test::Differences
+
+0.61 Sat April 16, 2011
+ - Allow an option to override Sortkeys in C<eq_or_diff>. Thanks to Mark
+ Zealey for the suggestion.
+ - Unnumbered tests. There's no point to them.
+
+0.60 Sat April 16, 2011
+ - Make '' and undef not equal. Thanks to Pavel Shaydo for the patch.
+ - Made Data::Dumper minimum version 2.126 to resolve
+ https://rt.cpan.org/Ticket/Display.html?id=60798. Thanks to
+ jjnapiork at cpan.org for the report and fix.
0.50 Sat Oct 17 15:18:03 2009
- Production release.
Modified: trunk/libtest-differences-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-differences-perl/MANIFEST?rev=72708&op=diff
==============================================================================
--- trunk/libtest-differences-perl/MANIFEST (original)
+++ trunk/libtest-differences-perl/MANIFEST Sun Apr 17 20:09:41 2011
@@ -5,12 +5,13 @@
MANIFEST
README
t/00-load.t
-t/00flatten.t
-t/01text_vs_data.t
-t/02pass.t
-t/03struct.t
-t/10test.t
-t/99example.t
+t/flatten.t
+t/text_vs_data.t
+t/pass.t
+t/struct.t
+t/test.t
+t/undef.t
+t/example.t
t/diff_styles.t
t/boilerplate.t
t/pod-coverage.t
Modified: trunk/libtest-differences-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-differences-perl/META.yml?rev=72708&op=diff
==============================================================================
--- trunk/libtest-differences-perl/META.yml (original)
+++ trunk/libtest-differences-perl/META.yml Sun Apr 17 20:09:41 2011
@@ -1,22 +1,24 @@
---
+abstract: 'Test strings and data structures and show differences if not ok'
+author:
+ - "Curtis \"Ovid\" Poe <ovid at cpan.org>"
+configure_requires:
+ Module::Build: 0.36
+generated_by: 'Module::Build version 0.3607'
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
name: Test-Differences
-version: 0.500
-author:
- - 'Curtis "Ovid" Poe <ovid at cpan.org>'
-abstract: Test strings and data structures and show differences if not ok
-license: perl
-resources:
- license: http://dev.perl.org/licenses/
-requires:
- Test::More: 0
- Text::Diff: 0.35
-configure_requires:
- Module::Build: 0.35
provides:
Test::Differences:
file: lib/Test/Differences.pm
- version: 0.500
-generated_by: Module::Build version 0.35
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ version: 0.61
+requires:
+ Data::Dumper: 2.126
+ Test::More: 0
+ Text::Diff: 0.35
+resources:
+ license: http://dev.perl.org/licenses/
+ repository: https://github.com/Ovid/Test-Differences
+version: 0.61
Modified: trunk/libtest-differences-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-differences-perl/Makefile.PL?rev=72708&op=diff
==============================================================================
--- trunk/libtest-differences-perl/Makefile.PL (original)
+++ trunk/libtest-differences-perl/Makefile.PL Sun Apr 17 20:09:41 2011
@@ -3,21 +3,26 @@
use ExtUtils::MakeMaker;
eval "use 5.006";
-if (my $error = $@) {
+if ( my $error = $@ ) {
warn $error;
exit 0;
}
WriteMakefile(
- NAME => 'Test::Differences',
- AUTHOR => 'Curtis "Ovid" Poe <ovid at cpan.org>',
- VERSION_FROM => 'lib/Test/Differences.pm',
- ABSTRACT_FROM => 'lib/Test/Differences.pm',
- PL_FILES => {},
- PREREQ_PM => {
- 'Test::More' => 0,
- 'Text::Diff' => 0.35,
+ NAME => 'Test::Differences',
+ AUTHOR => 'Curtis "Ovid" Poe <ovid at cpan.org>',
+ VERSION_FROM => 'lib/Test/Differences.pm',
+ ABSTRACT_FROM => 'lib/Test/Differences.pm',
+ PL_FILES => {},
+ PREREQ_PM => {
+ 'Test::More' => 0,
+ 'Text::Diff' => 0.35,
+ 'Data::Dumper' => 2.126,
},
- dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
- clean => { FILES => 'Test-Differences-*' },
+ dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
+ clean => { FILES => 'Test-Differences-*' },
+ META_MERGE => {
+ resources =>
+ { repository => 'https://github.com/Ovid/Test-Differences' }
+ },
);
Modified: trunk/libtest-differences-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-differences-perl/debian/changelog?rev=72708&op=diff
==============================================================================
--- trunk/libtest-differences-perl/debian/changelog (original)
+++ trunk/libtest-differences-perl/debian/changelog Sun Apr 17 20:09:41 2011
@@ -1,3 +1,10 @@
+libtest-differences-perl (0.61-1) UNRELEASED; urgency=low
+
+ * Added myself to Uploaders
+ * New upstream release
+
+ -- Nicholas Bamber <nicholas at periapt.co.uk> Sun, 17 Apr 2011 21:02:54 +0100
+
libtest-differences-perl (0.50.0-1) unstable; urgency=low
[ Ignace Mouzannar ]
Modified: trunk/libtest-differences-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-differences-perl/debian/control?rev=72708&op=diff
==============================================================================
--- trunk/libtest-differences-perl/debian/control (original)
+++ trunk/libtest-differences-perl/debian/control Sun Apr 17 20:09:41 2011
@@ -3,7 +3,8 @@
Priority: optional
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Jay Bonci <jaybonci at debian.org>, Damyan Ivanov <dmn at debian.org>,
- Ignace Mouzannar <mouzannar at gmail.com>
+ Ignace Mouzannar <mouzannar at gmail.com>,
+ Nicholas Bamber <nicholas at periapt.co.uk>
Build-Depends-Indep: debhelper (>= 7), perl, libtext-diff-perl, libtest-pod-coverage-perl, libtest-pod-perl
Standards-Version: 3.8.3
Homepage: http://search.cpan.org/dist/Test-Differences/
Modified: trunk/libtest-differences-perl/lib/Test/Differences.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-differences-perl/lib/Test/Differences.pm?rev=72708&op=diff
==============================================================================
--- trunk/libtest-differences-perl/lib/Test/Differences.pm (original)
+++ trunk/libtest-differences-perl/lib/Test/Differences.pm Sun Apr 17 20:09:41 2011
@@ -3,6 +3,10 @@
=head1 NAME
Test::Differences - Test strings and data structures and show differences if not ok
+
+=head1 VERSION
+
+0.61
=head1 SYNOPSIS
@@ -20,7 +24,7 @@
use DBI;
... open connection & prepare statement and @expected_... here...
-
+
eq_or_diff $sth->fetchall_arrayref, \@expected_arrays "testing DBI arrays";
eq_or_diff $sth->fetchall_hashref, \@expected_hashes, "testing DBI hashes";
@@ -139,14 +143,32 @@
=head1 OPTIONS
-There is currently only one option: "context". This allows you to
-control the amount of context shown:
+The options to C<eq_or_diff> give some fine-grained control over the output.
+
+=over 4
+
+=item * C<context>
+
+This allows you to control the amount of context shown:
eq_or_diff $got, $expected, $name, { context => 50000 };
will show you lots and lots of context. Normally, eq_or_diff() uses
some heuristics to determine whether to show 3 lines of context (like
a normal unified diff) or 25 lines.
+
+=item * C<data_type>
+
+C<text> or C<data>. See C<eq_or_diff_text> and C<eq_or_diff_data> to
+understand this. You can usually ignore this.
+
+=item * C<Sortkeys>
+
+If passed, whatever value is added is used as the argument for L<Data::Dumper>
+Sortkeys option. See the L<Data::Dumper> docs to understand how you can
+control the Sortkeys behavior.
+
+=back
=head1 DIFF STYLES
@@ -171,9 +193,9 @@
use Test::More 'no_plan';
use Test::Differences;
-
+
my $long_string = join '' => 1..40;
-
+
TODO: {
local $TODO = 'Testing diff styles';
@@ -192,7 +214,7 @@
eq_or_diff $long_string, "-$long_string", 'oldstyle diff';
}
-=head1 DEPLOYING
+=head1 DEPLOYING
There are several basic ways of deploying Test::Differences requiring more or less
labor by you or your users.
@@ -261,15 +283,15 @@
=cut
-our $VERSION = "0.500"; # or "0.001_001" for a dev release
+our $VERSION = "0.61"; # or "0.001_001" for a dev release
$VERSION = eval $VERSION;
use Exporter;
@ISA = qw( Exporter );
- at EXPORT = qw(
- eq_or_diff
- eq_or_diff_text
+ at EXPORT = qw(
+ eq_or_diff
+ eq_or_diff_text
eq_or_diff_data
unified_diff
context_diff
@@ -340,7 +362,7 @@
my $type = shift;
local $_ = shift if @_;
- return [ split /^/m ] unless ref;
+ return [ split /^/m, _quote_str($_) ] unless ref;
croak "Can't flatten $_" unless $type;
@@ -355,7 +377,10 @@
else {
die "unsupported ref type";
}
- if ( $type eq ARRAY_of_ARRAYs_of_scalars ) {
+ if ( $type eq ARRAY_of_scalars) {
+ @recs = map { _quote_str($_) } @recs;
+ }
+ elsif ( $type eq ARRAY_of_ARRAYs_of_scalars ) {
## Also copy the inner arrays if need be
$_ = [@$_] for @recs;
}
@@ -382,16 +407,24 @@
}
if ( $type eq ARRAY_of_ARRAYs_of_scalars ) {
- ## Convert undefs
+ ## Quote strings
for my $rec (@recs) {
for (@$rec) {
- $_ = "<undef>" unless defined;
+ $_ = _quote_str($_);
}
$rec = join ",", @$rec;
}
}
return \@recs;
+}
+
+sub _quote_str {
+ my $str = shift;
+ return 'undef' unless defined $str;
+ return $str if $str =~ /^[0-9]+$/;
+ $str =~ s{([\\\'])}{\\$1}g;
+ return "'$str'";
}
sub _identify_callers_test_package_of_choice {
@@ -443,11 +476,12 @@
if ($dump_it) {
require Data::Dumper;
local $Data::Dumper::Indent = 1;
- local $Data::Dumper::Sortkeys = 1;
local $Data::Dumper::Purity = 0;
local $Data::Dumper::Terse = 1;
local $Data::Dumper::Deepcopy = 1;
local $Data::Dumper::Quotekeys = 0;
+ local $Data::Dumper::Sortkeys =
+ exists $options->{Sortkeys} ? $options->{Sortkeys} : 1;
( $got, $expected ) = map
[ split /^/, Data::Dumper::Dumper($_) ],
@vals;
@@ -569,17 +603,17 @@
not ok 5
# Failed test (t/ctrl/05-home.t at line 51)
- # +----+------------------------+----+------------------------+
- # | Elt|Got | Elt|Expected |
- # +----+------------------------+----+------------------------+
- # | 0|{ | 0|{ |
- # | 1| 'password' => '', | 1| 'password' => '', |
- # * 2| 'method' => 'login', * | |
- # | 3| 'ctrl' => 'home', | 2| 'ctrl' => 'home', |
- # | | * 3| 'method' => 'login', *
- # | 4| 'email' => 'test' | 4| 'email' => 'test' |
- # | 5|} | 5|} |
- # +----+------------------------+----+------------------------+
+ # +----+------------------------+----+------------------------+
+ # | Elt|Got | Elt|Expected |
+ # +----+------------------------+----+------------------------+
+ # | 0|{ | 0|{ |
+ # | 1| 'password' => '', | 1| 'password' => '', |
+ # * 2| 'method' => 'login', * | |
+ # | 3| 'ctrl' => 'home', | 2| 'ctrl' => 'home', |
+ # | | * 3| 'method' => 'login', *
+ # | 4| 'email' => 'test' | 4| 'email' => 'test' |
+ # | 5|} | 5|} |
+ # +----+------------------------+----+------------------------+
Data::Dumper also overlooks the difference between
More information about the Pkg-perl-cvs-commits
mailing list