Added libtest-differences-perl
authorNito Martinez <Nito@Qindel.ES>
Fri, 16 Apr 2010 05:42:00 +0000 (06:42 +0100)
committerNito Martinez <Nito@Qindel.ES>
Fri, 16 Apr 2010 05:42:00 +0000 (06:42 +0100)
27 files changed:
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/Changes [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/Differences.pm [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/MANIFEST [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/MANIFEST.SKIP [new file with mode: 0755]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/Makefile.PL [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/changelog [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/compat [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/control [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/copyright [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/rules [new file with mode: 0755]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/watch [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/eg/to_diff_or_not_to_diff [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/00flatten.t [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/01text_vs_data.t [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/02pass.t [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/03struct.t [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/10test.t [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/20test_more.t [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/99example.t [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2.diff.gz [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2.dsc [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2maemo1.diff.gz [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2maemo1.dsc [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2maemo1_i386.changes [new file with mode: 0644]
deb-src/libtest-differences-perl/libtest-differences-perl_0.47.orig.tar.gz [new file with mode: 0644]
deb/pool/main/libt/libtest-differences-perl/libtest-differences-perl_0.47-2maemo1_all.deb [new file with mode: 0644]
scripts/remove-higher-perl-deps.sh

diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/Changes b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/Changes
new file mode 100644 (file)
index 0000000..ef0ce11
--- /dev/null
@@ -0,0 +1,47 @@
+Changes file for Test::Differences
+
+0.47 Tue Jun 17 08:54:59 EDT 2003
+    - Add context option (reworked patch from fetko@slaysys.com)
+    - Improve options handling for eq_or_diff(), $name is no longer
+      required before \%options
+    - Use **, not ^, for exponentiation
+      ("Blake D. Mills IV" <blakem@blakem.com>)
+
+0.46 Tue Aug 27 13:45:51 EDT 2002
+    - Minor doc tweaks
+
+0.45 Sun Jul 14 06:58:48 EDT 2002
+    - Fix $Data::Dumper::FooBar to be ...::Foobar, patch by
+      Ilya Martynov <ilya@martynov.org>
+    - Correct the "use Test::Differences" example.
+    - Require Text::Diff 0.34 in to get escaping fixes.
+
+0.44 Mon Jul  8 17:02:11 EDT 2002
+    - Document Data::Dumper shortcomings reported by Yves Orton
+    <demerphq@hotmail.com> and Ilya Martynov <ilya@martynov.org>.
+
+0.43 Mon May 13 09:49:50 EDT 2002
+    - Dump "unknown" structures instead of treating them like
+      arrays of scalars.  Reported by Yves Orton <demerphq@hotmail.com>.
+
+0.42 Wed Jan  2 21:31:32 EST 2002
+    - T.J. Mather spotted a bug where two identical results would compare
+    as different, causing false negatives.
+
+0.41
+    - forgot to log this change.
+
+0.4 Fri Dec 21 08:55:13 EST 2001
+    - Moved table style diffs and escaping in to Test::Diff
+    - Improve docs
+    - Add a few more tests
+
+0.3 Sat Dec 15 02:06:26 EST 2001
+    - Only use Data::Dumper on both args or neither arg.
+    - Improve escaping (Michael G Schwern <schwern@pobox.com>,
+    - remove leftover debugging code (Tatsuhiko Miyagawa <miyagawa@edge.co.jp>)
+    - add t/00escape.t
+    - PREREQ_PM => 'Text::Diff' (Michael G Schwern <schwern@pobox.com>)
+
+0.2
+    - Initial public release
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/Differences.pm b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/Differences.pm
new file mode 100644 (file)
index 0000000..e7f11ed
--- /dev/null
@@ -0,0 +1,485 @@
+package Test::Differences;
+
+=head1 NAME
+
+Test::Differences - Test strings and data structures and show differences if not ok
+
+=head1 SYNOPSIS
+
+   use Test;    ## Or use Test::More
+   use Test::Differences;
+
+   eq_or_diff $got,  "a\nb\nc\n",   "testing strings";
+   eq_or_diff \@got, [qw( a b c )], "testing arrays";
+
+   ## Passing options:
+   eq_or_diff $got, $expected, $name, { context => 300 };  ## options
+
+   ## Using with DBI-like data structures
+
+   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";
+
+   ## To force textual or data line numbering (text lines are numbered 1..):
+   eq_or_diff_text ...;
+   eq_or_diff_data ...;
+
+=head1 DESCRIPTION
+
+When the code you're testing returns multiple lines, records or data
+structures and they're just plain wrong, an equivalent to the Unix
+C<diff> utility may be just what's needed.  Here's output from an
+example test script that checks two text documents and then two
+(trivial) data structures:
+
+ t/99example....1..3
+ not ok 1 - differences in text
+ #     Failed test ((eval 2) at line 14)
+ #     +---+----------------+----------------+
+ #     | Ln|Got             |Expected        |
+ #     +---+----------------+----------------+
+ #     |  1|this is line 1  |this is line 1  |
+ #     *  2|this is line 2  |this is line b  *
+ #     |  3|this is line 3  |this is line 3  |
+ #     +---+----------------+----------------+
+ not ok 2 - differences in whitespace
+ #     Failed test ((eval 2) at line 20)
+ #     +---+------------------+------------------+
+ #     | Ln|Got               |Expected          |
+ #     +---+------------------+------------------+
+ #     |  1|        indented  |        indented  |
+ #     *  2|        indented  |\tindented        *
+ #     |  3|        indented  |        indented  |
+ #     +---+------------------+------------------+
+ not ok 3
+ #     Failed test ((eval 2) at line 22)
+ #     +----+-------------------------------------+----------------------------+
+ #     | Elt|Got                                  |Expected                    |
+ #     +----+-------------------------------------+----------------------------+
+ #     *   0|bless( [                             |[                           *
+ #     *   1|  'Move along, nothing to see here'  |  'Dry, humorless message'  *
+ #     *   2|], 'Test::Builder' )                 |]                           *
+ #     +----+-------------------------------------+----------------------------+
+ # Looks like you failed 3 tests of 3.
+
+eq_or_diff_...() compares two strings or (limited) data structures and
+either emits an ok indication or a side-by-side diff.  Test::Differences
+is designed to be used with Test.pm and with Test::Simple, Test::More,
+and other Test::Builder based testing modules.  As the SYNOPSIS shows,
+another testing module must be used as the basis for your test suite.
+
+These functions assume that you are presenting it with "flat" records,
+looking like:
+
+   - scalars composed of record-per-line
+   - arrays of scalars,
+   - arrays of arrays of scalars,
+   - arrays of hashes containing only scalars
+
+All of these are flattened in to single strings which are then compared
+for differences.  Differently data structures can be compared, as long
+as they flatten identically.
+
+All other data structures are run through Data::Dumper first.  This is a
+bit dangerous, as some versions of perl shipped with Data::Dumpers that
+could do the oddest things with unexpected, like core dump.  Only as of
+5.8.0 does Data::Dumper sort hash keys, which is necessary for HASH
+dumps to be fully predictable.  This will be changed when this bites
+somebody or I get some free time.
+
+C<eq_or_diff()> starts counting records at 0 unless you pass it two text
+strings:
+
+   eq_or_diff $a, $b;   ## First line is line number 1
+   eq_or_diff @a, @b;   ## First element is element 0
+   eq_or_diff $a, @b;   ## First line/element is element 0
+
+If you want to force a first record number of 0, use C<eq_or_diff_data>.  If
+you want to force a first record number of 1, use C<eq_or_diff_text>.  I chose
+this over passing in an options hash because it's clearer and simpler this way.
+YMMV.
+
+=head1 OPTIONS
+
+There is currently only one option: "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 (for 
+
+=head1 Deploying Test::Differences
+
+There are three basic ways of deploying Test::Differences requiring more or less
+labor by you or your users.
+
+=over
+
+=item *
+
+eval "use Test::Differences";
+
+This is the easiest option.
+
+If you want to detect the presence of Test::Differences on the fly, something
+like the following code might do the trick for you:
+
+    use Test qw( !ok );   ## get all syms *except* ok
+
+    eval "use Test::Differences";
+    use Data::Dumper;
+
+    sub ok {
+        goto &eq_or_diff if defined &eq_or_diff && @_ > 1;
+        @_ = map ref $_ ? Dumper( @_ ) : $_, @_;
+        goto Test::&ok;
+    }
+
+    plan tests => 1;
+
+    ok "a", "b";
+
+=item *
+
+PREREQ_PM => { .... "Test::Differences" => 0, ... }
+
+This method will let CPAN and CPANPLUS users download it automatically.  It
+will discomfit those users who choose/have to download all packages manually.
+
+=item *
+
+t/lib/Test/Differences.pm, t/lib/Text/Diff.pm, ...
+
+By placing Test::Differences and it's prerequisites in the t/lib directory, you
+avoid forcing your users to download the Test::Differences manually if they
+aren't using CPAN or CPANPLUS.
+
+If you put a C<use lib "t/lib";> in the top of each test suite before the
+C<use Test::Differences;>, C<make test> should work well.
+
+You might want to check once in a while for new Test::Differences releases
+if you do this.
+
+
+
+=back
+
+
+=head1 LIMITATIONS
+
+This module "mixes in" with Test.pm or any of the test libraries based on
+Test::Builder (Test::Simple, Test::More, etc).  It does this by 
+peeking to see whether Test.pm or Test/Builder.pm is in %INC, so if you are
+not using one of those, it will print a warning and play dumb by not emitting
+test numbers (or incrementing them).  If you are using one of these, it
+should interoperate nicely.
+
+Uses Data::Dumper for complex data structures (like hashes :), which can lead
+to some problems on older perls.
+
+Exports all 3 functions by default (and by design).  Use
+
+    use Test::Differences ();
+
+to suppress this behavior if you don't like the namespace pollution.
+
+This module will not override functions like ok(), is(), is_deeply(), etc.  If
+it did, then you could C<eval "use Test::Differences qw( is_deeply );"> to get
+automatic upgrading to diffing behaviors without the C<sub my_ok> shown above.
+Test::Differences intentionally does not provide this behavior because this
+would mean that Test::Differences would need to emulate every popular test
+module out there, which would require far more coding and maintenance that I'm
+willing to do.  Use the eval and my_ok deployment shown above if you want some
+level of automation.
+
+=cut
+
+$VERSION = 0.47;
+
+use Exporter;
+
+@ISA = qw( Exporter );
+@EXPORT = qw( eq_or_diff eq_or_diff_text eq_or_diff_data );
+
+use strict;
+
+use Carp;
+use Text::Diff;
+
+sub _isnt_ARRAY_of_scalars {
+    return 1 if ref ne "ARRAY";
+    return scalar grep ref, @$_;
+}
+
+
+sub _isnt_HASH_of_scalars {
+    return 1 if ref ne "HASH";
+    return scalar grep ref, keys %$_;
+}
+
+use constant ARRAY_of_scalars           => "ARRAY of scalars";
+use constant ARRAY_of_ARRAYs_of_scalars => "ARRAY of ARRAYs of scalars";
+use constant ARRAY_of_HASHes_of_scalars => "ARRAY of HASHes of scalars";
+
+
+sub _grok_type {
+    local $_ = shift if @_;
+    return "SCALAR" unless ref ;
+    if ( ref eq "ARRAY" ) {
+        return undef unless @$_;
+        return ARRAY_of_scalars unless 
+            _isnt_ARRAY_of_scalars;
+        return ARRAY_of_ARRAYs_of_scalars 
+            unless grep _isnt_ARRAY_of_scalars, @$_;
+        return ARRAY_of_HASHes_of_scalars
+            unless grep _isnt_HASH_of_scalars, @$_;
+        return 0;
+    }
+}
+
+
+## Flatten any acceptable data structure in to an array of lines.
+sub _flatten {
+    my $type = shift;
+    local $_ = shift if @_;
+
+    return [ split /^/m ] unless ref;
+
+    croak "Can't flatten $_" unless $type ;
+
+    ## Copy the top level array so we don't trash the originals
+    my @recs = @$_;
+
+    if ( $type eq ARRAY_of_ARRAYs_of_scalars ) {
+        ## Also copy the inner arrays if need be
+        $_ = [ @$_ ] for @recs;
+    }
+
+
+    if ( $type eq ARRAY_of_HASHes_of_scalars ) {
+        my %headings;
+        for my $rec ( @recs ) {
+            $headings{$_} = 1 for keys %$rec;
+        }
+        my @headings = sort keys %headings;
+
+        ## Convert all hashes in to arrays.
+        for my $rec ( @recs ) {
+            $rec = [ map $rec->{$_}, @headings ],
+        }
+
+        unshift @recs, \@headings;
+
+        $type = ARRAY_of_ARRAYs_of_scalars;
+    }
+
+    if ( $type eq ARRAY_of_ARRAYs_of_scalars ) {
+        ## Convert undefs
+        for my $rec ( @recs ) {
+            for ( @$rec ) {
+                $_ = "<undef>" unless defined;
+            }
+            $rec = join ",", @$rec;
+        }
+    }
+
+    return \@recs;
+}
+
+
+sub _identify_callers_test_package_of_choice {
+    ## This is called at each test in case Test::Differences was used before
+    ## the base testing modules.
+    ## First see if %INC tells us much of interest.
+    my $has_builder_pm = grep $_ eq "Test/Builder.pm", keys %INC;
+    my $has_test_pm    = grep $_ eq "Test.pm",         keys %INC;
+
+    return "Test"          if $has_test_pm && ! $has_builder_pm;
+    return "Test::Builder" if ! $has_test_pm && $has_builder_pm;
+
+    if ( $has_test_pm && $has_builder_pm ) {
+        ## TODO: Look in caller's namespace for hints.  For now, assume Builder.
+        ## This should only ever be an issue if multiple test suites end
+        ## up in memory at once.
+        return "Test::Builder";
+    }
+}
+
+
+my $warned_of_unknown_test_lib;
+
+sub eq_or_diff_text { $_[3] = { data_type => "text" }; goto &eq_or_diff; }
+sub eq_or_diff_data { $_[3] = { data_type => "data" }; goto &eq_or_diff; }
+
+## This string is a cheat: it's used to see if the two arrays of values
+## are identical.  The stringified values are joined using this joint
+## and compared using eq.  This is a deep equality comparison for
+## references and a shallow one for scalars.
+my $joint = chr( 0 ) . "A" . chr( 1 );
+
+sub eq_or_diff {
+    my ( @vals, $name, $options );
+    $options = pop if @_ > 2 && ref $_[-1];
+    ( $vals[0], $vals[1], $name ) = @_;
+
+    my $data_type;
+    $data_type = $options->{data_type} if $options;
+    $data_type ||= "text" unless ref $vals[0] || ref $vals[1];
+    $data_type ||= "data";
+
+    my @widths;
+
+    my @types = map _grok_type, @vals;
+
+    my $dump_it = !$types[0] || !$types[1];
+
+    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;
+        @vals = map 
+           [ split /^/, Data::Dumper::Dumper( $_ ) ],
+           @vals;
+    }
+    else {
+       @vals = (
+           _flatten( $types[0], $vals[0] ),
+           _flatten( $types[1], $vals[1] )
+       );
+    }
+
+    my $caller = caller;
+
+    my $passed = join( $joint, @{$vals[0]} ) eq
+                 join( $joint, @{$vals[1]} );
+
+    my $diff;
+    unless ( $passed ) {
+        my $context;
+
+        $context = $options->{context}
+            if exists $options->{context};
+
+        $context = $dump_it ? 2**31 : grep( @$_ > 25, @vals ) ? 3 : 25
+            unless defined $context;
+
+        confess "context must be an integer: '$context'\n"
+            unless $context =~ /\A\d+\z/;
+
+        $diff = diff @vals, {
+            CONTEXT     => $context,
+            STYLE       => "Table",
+           FILENAME_A  => "Got",
+           FILENAME_B  => "Expected",
+            OFFSET_A    => $data_type eq "text" ? 1 : 0,
+            OFFSET_B    => $data_type eq "text" ? 1 : 0,
+            INDEX_LABEL => $data_type eq "text" ? "Ln" : "Elt",
+        };
+        chomp $diff;
+        $diff .= "\n";
+    }
+
+    my $which = _identify_callers_test_package_of_choice;
+
+    if ( $which eq "Test" ) {
+        @_ = $passed 
+            ? ( "", "", $name )
+            : ( "\n$diff", "No differences", $name );
+        goto &Test::ok;
+    }
+    elsif ( $which eq "Test::Builder" ) {
+        my $test = Test::Builder->new;
+        ## TODO: Call exported_to here?  May not need to because the caller
+        ## should have imported something based on Test::Builder already.
+        $test->ok( $passed, $name );
+        $test->diag( $diff ) unless $passed;
+    }
+    else {
+        unless ( $warned_of_unknown_test_lib ) {
+            Carp::cluck
+                "Can't identify test lib in use, doesn't seem to be Test.pm or Test::Builder based\n";
+            $warned_of_unknown_test_lib = 1;
+        }
+        ## Play dumb and hope nobody notices the fool drooling in the corner
+        if ( $passed ) {
+            print "ok\n";
+        }
+        else {
+            $diff =~ s/^/# /gm;
+            print "not ok\n", $diff;
+        }
+    }
+}
+
+
+=head1 LIMITATIONS
+
+Perls before 5.6.0 don't support characters > 255 at all, and 5.6.0
+seems broken.  This means that you might get odd results using perl5.6.0
+with unicode strings.
+
+Relies on Data::Dumper (for now), which, prior to perl5.8, will not
+always report hashes in the same order.  C< $Data::Dumper::SortKeys >
+I<is> set to 1, so on more recent versions of Data::Dumper, this should
+not occur.  Check CPAN to see if it's been peeled out of the main perl
+distribution and backported.  Reported by Ilya Martynov
+<ilya@martynov.org>, although the SortKeys "future perfect" workaround
+has been set in anticipation of a new Data::Dumper for a while.  Note
+that the two hashes should report the same here:
+
+    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|}                       |   
+    # +----+------------------------+----+------------------------+   
+
+Data::Dumper also overlooks the difference between
+
+    $a[0] = \$a[1];
+    $a[1] = \$a[0];   # $a[0] = \$a[1]
+
+and
+
+    $x = \$y;
+    $y = \$x;
+    @a = ( $x, $y );  # $a[0] = \$y, not \$a[1]
+
+The former involves two scalars, the latter 4: $x, $y, and @a[0,1].
+This was carefully explained to me in words of two syllables or less by
+Yves Orton <demerphq@hotmail.com>.  The plan to address this is to allow
+you to select Data::Denter or some other module of your choice as an
+option.
+
+=head1 AUTHOR
+
+    Barrie Slaymaker <barries@slaysys.com>
+
+=head1 LICENSE
+
+Copyright 2001 Barrie Slaymaker, All Rights Reserved.
+
+You may use this software under the terms of the GNU public license, any
+version, or the Artistic license.
+
+=cut
+
+
+1;
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/MANIFEST b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/MANIFEST
new file mode 100644 (file)
index 0000000..10bc29e
--- /dev/null
@@ -0,0 +1,13 @@
+Changes
+Differences.pm
+MANIFEST
+MANIFEST.SKIP
+Makefile.PL
+eg/to_diff_or_not_to_diff
+t/00flatten.t
+t/01text_vs_data.t
+t/02pass.t
+t/03struct.t
+t/10test.t
+t/20test_more.t
+t/99example.t
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/MANIFEST.SKIP b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/MANIFEST.SKIP
new file mode 100755 (executable)
index 0000000..9dd41fe
--- /dev/null
@@ -0,0 +1,13 @@
+CVS/.*
+\.bak$
+\.sw[a-z]$
+\.tar$
+\.tgz$
+\.tar\.gz$
+^mess/
+^tmp/
+^blib/
+^Makefile$
+^Makefile\.[a-z]+$
+^pm_to_blib$
+~$
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/Makefile.PL b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/Makefile.PL
new file mode 100644 (file)
index 0000000..8976b27
--- /dev/null
@@ -0,0 +1,19 @@
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+    NAME          => "Test::Differences",
+    VERSION_FROM  => "Differences.pm",
+    PREREQ_PM     => {
+        "Text::Diff" => 0.34,
+    },
+);
+
+
+sub MY::libscan {
+   package MY ;
+   my $self = shift ;
+   my ( $path ) = @_ ;
+   return '' if /\.sw[a-z]$/ ;
+   return '' unless length $self->SUPER::libscan( $path ) ;
+   return $path ;
+}
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/changelog b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/changelog
new file mode 100644 (file)
index 0000000..b5d10f8
--- /dev/null
@@ -0,0 +1,18 @@
+libtest-differences-perl (0.47-2maemo1) fremantle; urgency=low
+
+  * New Maemo packaging
+
+ -- Nito Martinez <Nito@Qindel.ES>  Fri, 16 Apr 2010 06:35:54 +0100
+
+
+libtest-differences-perl (0.47-2) unstable; urgency=low
+
+  * Adds debian/watch so uscan will actually work.
+
+ -- Jay Bonci <jaybonci@debian.org>  Mon, 11 Oct 2004 01:44:50 -0400
+
+libtest-differences-perl (0.47-1) unstable; urgency=low
+
+  * Initial Release (Closes: #178083)
+
+ -- Jay Bonci <jaybonci@debian.org>  Sun, 21 Sep 2003 03:35:41 -0400
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/compat b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/compat
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/control b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/control
new file mode 100644 (file)
index 0000000..940cf95
--- /dev/null
@@ -0,0 +1,15 @@
+Source: libtest-differences-perl
+Section: perl
+Priority: optional
+Maintainer: Jay Bonci <jaybonci@debian.org>
+Build-Depends-Indep: debhelper (>> 4.0.0), perl (>= 5.6.0-16), libtext-diff-perl
+Standards-Version: 3.6.1.0
+
+Package: libtest-differences-perl
+Architecture: all
+Depends: ${perl:Depends}, libtext-diff-perl
+Description: Test string and data structure differences in perl
+ CPAN's Test::Differences compares data structures and strings
+ and returns their differences in a UNIX diff fashion if they
+ are "not ok". Useful for comparing large structures easily
+ when running tests.
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/copyright b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/copyright
new file mode 100644 (file)
index 0000000..b55e7fe
--- /dev/null
@@ -0,0 +1,18 @@
+This package was debianized by Jay Bonci <jay@bonci.com> on
+Thu, 23 Jan 2003 10:00:55 -0500.
+
+It was downloaded from http://search.cpan.org/dist/Test-Differences
+
+Upstream Author: Barrie Slaymaker <barries@slaysys.com>
+
+Copyright:
+
+You may use this software under the terms of the GNU public license, 
+any version, or the Artistic license
+
+Please see
+/usr/share/common-licenses/Artistic
+ - or -
+/usr/share/common-licenses/GPL
+
+For more information regarding these licensing options 
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/rules b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/rules
new file mode 100755 (executable)
index 0000000..032b2b9
--- /dev/null
@@ -0,0 +1,53 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatibility version to use.
+# export DH_COMPAT=4
+
+PACKAGE=`pwd | sed -e "s/.*\/\\(.*\\)-.*/\\1/"`
+
+
+build:
+       dh_testdir
+       # Add here commands to compile the package.
+       perl Makefile.PL verbose INSTALLDIRS=vendor
+clean:
+       dh_testdir
+       dh_testroot
+
+       -$(MAKE) clean
+       rm -f Makefile.old
+       dh_clean
+
+install:
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+       dh_installdirs
+
+       $(MAKE) PREFIX=$(CURDIR)/debian/$(PACKAGE)/usr OPTIMIZE="-O2 -g -Wall" test install
+       -find $(CURDIR)/debian -type d | xargs rmdir -p --ignore-fail-on-non-empty
+
+binary-arch:;
+binary-indep: build install
+       dh_testdir
+       dh_testroot
+       dh_installdocs
+       dh_installman
+       dh_installchangelogs Changes
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+       dh_installdeb
+       dh_perl
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/watch b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/debian/watch
new file mode 100644 (file)
index 0000000..b7cdcf8
--- /dev/null
@@ -0,0 +1,2 @@
+version=2
+http://www.cpan.org/modules/by-module/Test/Test-Differences-([0-9].*)\.tar.gz
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/eg/to_diff_or_not_to_diff b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/eg/to_diff_or_not_to_diff
new file mode 100644 (file)
index 0000000..f879d47
--- /dev/null
@@ -0,0 +1,12 @@
+use Test;
+
+eval "use Test::Differences";
+
+sub my_ok {
+    goto &eq_or_diff if defined &eq_or_diff;
+    goto &ok;
+}
+
+plan tests => 1;
+
+my_ok "a", "b";
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/00flatten.t b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/00flatten.t
new file mode 100644 (file)
index 0000000..159dd8b
--- /dev/null
@@ -0,0 +1,30 @@
+use Test ;
+
+use Test::Differences ;
+
+sub f($) {
+    my $out = join "|",
+        @{Test::Differences::_flatten( 
+           Test::Differences::_grok_type( $_[0] ),
+           $_[0]
+       )
+    } ;
+    $out =~ s/ +//g ;
+    $out ;
+}
+
+my @tests = (
+sub { ok f "a",                      "a"           },
+sub { ok f "a\nb\n",                 "a\n|b\n"     },
+sub { ok f [qw( a b )],              "a|b"         },
+sub { ok f [[qw( a b )], [qw(c d)]], "a,b|c,d"     },
+sub { ok f [{ a => 0, b => 1 }, { a => 2, c => 3}],
+    "a,b,c|0,1,<undef>|2,<undef>,3"
+},
+## Complex data structures are not flattened, they're dumped, so don't
+## test that here.
+) ;
+
+plan tests => scalar @tests ;
+
+$_->() for @tests ;
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/01text_vs_data.t b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/01text_vs_data.t
new file mode 100644 (file)
index 0000000..9cadbcf
--- /dev/null
@@ -0,0 +1,18 @@
+use Test ;
+
+use Test::Differences ;
+
+# use large enough data sets that this thing chooses context => 3 instead
+# of "full document context".
+my $a = ("\n" x 30 ) . "a\n" ;
+my $b = ("\n" x 30 ) . "b\n" ;
+
+my @tests = (
+sub { eq_or_diff $a, $b },
+sub { eq_or_diff_text $a, $b },
+sub { eq_or_diff_data $a, $b },
+) ;
+
+plan tests => scalar @tests, todo => [1..@tests] ;
+
+$_->() for @tests ;
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/02pass.t b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/02pass.t
new file mode 100644 (file)
index 0000000..f22dd75
--- /dev/null
@@ -0,0 +1,16 @@
+use Test ;
+
+use Test::Differences ;
+
+# use large enough data sets that this thing chooses context => 3 instead
+# of "full document context".
+my $a = ("\n" x 30 ) . "a\n" ;
+my $b = ("\n" x 30 ) . "b\n" ;
+
+my @tests = (
+sub { eq_or_diff [ "a", "b" ], [ "a", "b" ] },
+) ;
+
+plan tests => scalar @tests;
+
+$_->() for @tests ;
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/03struct.t b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/03struct.t
new file mode 100644 (file)
index 0000000..7f1900e
--- /dev/null
@@ -0,0 +1,19 @@
+use Test ;
+
+use Test::Differences ;
+
+## This mind-bender submitted by Yves Orton <demerphq@hotmail.com>
+my ( $ar, $x, $y );
+$ar->[0] = \$ar->[1];
+$ar->[1] = \$ar->[0];
+$x = \$y;
+$y = \$x;
+
+my @tests = (
+sub { eq_or_diff [ \"a", \"b" ], [ \"a", \"b" ] },
+sub { eq_or_diff $ar, [ $x, $y ] },
+) ;
+
+plan tests => scalar @tests;
+
+$_->() for @tests ;
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/10test.t b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/10test.t
new file mode 100644 (file)
index 0000000..60533d2
--- /dev/null
@@ -0,0 +1,19 @@
+use Test ;
+
+use Test::Differences ;
+
+my @tests = (
+sub { eq_or_diff "a", "a" },
+sub { eq_or_diff "a", "b" },
+sub { eq_or_diff "a\nb\nc\n", "a\nc\n" },
+sub { eq_or_diff "a\nb\nc\n", "a\nB\nc\n" },
+sub { eq_or_diff "a\nb\nc\nd\ne\n", "a\nc\ne\n" },
+sub { eq_or_diff "a\nb\nc\nd\ne\n", "a\nb\nd\ne\n", { context => 0 } },
+sub { eq_or_diff "a\nb\nc\nd\ne\n", "a\nb\nd\ne\n", { context => 10 } },
+) ;
+
+plan tests => scalar @tests, todo => [2..@tests] ;
+
+print "# This test misuses TODO: these TODOs are actually real tests.\n";
+
+$_->() for @tests ;
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/20test_more.t b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/20test_more.t
new file mode 100644 (file)
index 0000000..34884fb
--- /dev/null
@@ -0,0 +1,13 @@
+use Test::More ;
+
+use Test::Differences ;
+
+plan tests => 2 ;
+
+eq_or_diff "a", "a" ;
+
+print "# This test misuses TODO: these TODOs are actually real tests.\n";
+TODO: {
+    local $TODO = "testing failure, not really a TODO" ;
+    eq_or_diff "a", "b" ;
+}
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/99example.t b/deb-src/libtest-differences-perl/libtest-differences-perl-0.47/t/99example.t
new file mode 100644 (file)
index 0000000..0c588ff
--- /dev/null
@@ -0,0 +1,41 @@
+use strict;
+my $x;
+
+my $demo = $ENV{DEMO};
+
+eval <<'PRELOAD' ? eval <<'TEST' : ( $x = $@, eval <<'FALLBACK' );
+    use Test::More;
+    1;
+PRELOAD
+    use Test::Differences;
+
+    plan tests => 3 ;
+
+    print "#\n# This test misuses TODO:",
+          " these TODOs are actually real tests.\n#\n"
+        unless $demo;
+    TODO: {
+        local $TODO = "testing failure, not really a TODO" unless $demo;
+        my @docs = (
+            join( "", map "this is line $_\n", qw( 1 2 3 ) ),
+            join( "", map "this is line $_\n", qw( 1 b 3 ) )
+        );
+        eq_or_diff @docs, "differences in text";
+
+        @docs = ( ( "        indented\n" x 3 ) x 2 );
+
+        $docs[1] =~ s/(^..*?^)\s+/$1\t/ms or die "Can't subst \\t for ' '";
+
+        eq_or_diff @docs, "differences in whitespace";
+
+        eq_or_diff( Test::Builder->new, [ "Dry, humorless message" ] );
+    }
+TEST
+    use Test;
+
+    plan tests => 1;
+
+    skip $x, "" ;
+FALLBACK
+
+die $@ if $@ ;
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2.diff.gz b/deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2.diff.gz
new file mode 100644 (file)
index 0000000..80c276e
Binary files /dev/null and b/deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2.diff.gz differ
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2.dsc b/deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2.dsc
new file mode 100644 (file)
index 0000000..7a57d8e
--- /dev/null
@@ -0,0 +1,22 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+Format: 1.0
+Source: libtest-differences-perl
+Version: 0.47-2
+Binary: libtest-differences-perl
+Maintainer: Jay Bonci <jaybonci@debian.org>
+Architecture: all
+Standards-Version: 3.6.1.0
+Build-Depends-Indep: debhelper (>> 4.0.0), perl (>= 5.6.0-16), libtext-diff-perl
+Files: 
+ e4fa76bb11b0d1db2d4213390413f5af 8322 libtest-differences-perl_0.47.orig.tar.gz
+ 7db911b0fa0987863cf046bf6640dc4d 1460 libtest-differences-perl_0.47-2.diff.gz
+
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.2.5 (GNU/Linux)
+
+iD8DBQFBah4+ZNh5D+C4st4RAtBZAJ0dJ4HCpLD3ntYVFZzwecVYHFykKwCfRFTV
+PYCRPWMRHdBCIYMc9MggmnU=
+=s4Xc
+-----END PGP SIGNATURE-----
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2maemo1.diff.gz b/deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2maemo1.diff.gz
new file mode 100644 (file)
index 0000000..60dc7c1
Binary files /dev/null and b/deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2maemo1.diff.gz differ
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2maemo1.dsc b/deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2maemo1.dsc
new file mode 100644 (file)
index 0000000..77407c8
--- /dev/null
@@ -0,0 +1,11 @@
+Format: 1.0
+Source: libtest-differences-perl
+Version: 0.47-2maemo1
+Binary: libtest-differences-perl
+Maintainer: Jay Bonci <jaybonci@debian.org>
+Architecture: all
+Standards-Version: 3.6.1.0
+Build-Depends-Indep: debhelper (>> 4.0.0), perl (>= 5.6.0-16), libtext-diff-perl
+Files: 
+ e4fa76bb11b0d1db2d4213390413f5af 8322 libtest-differences-perl_0.47.orig.tar.gz
+ 5d4abec3fa0e3b9132be533a19c9c7c5 1533 libtest-differences-perl_0.47-2maemo1.diff.gz
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2maemo1_i386.changes b/deb-src/libtest-differences-perl/libtest-differences-perl_0.47-2maemo1_i386.changes
new file mode 100644 (file)
index 0000000..c8c5ec6
--- /dev/null
@@ -0,0 +1,20 @@
+Format: 1.7
+Date: Fri, 16 Apr 2010 06:35:54 +0100
+Source: libtest-differences-perl
+Binary: libtest-differences-perl
+Architecture: source all
+Version: 0.47-2maemo1
+Distribution: fremantle
+Urgency: low
+Maintainer: Jay Bonci <jaybonci@debian.org>
+Changed-By: Nito Martinez <Nito@Qindel.ES>
+Description: 
+ libtest-differences-perl - Test string and data structure differences in perl
+Changes: 
+ libtest-differences-perl (0.47-2maemo1) fremantle; urgency=low
+ .
+   * New Maemo packaging
+Files: 
+ 7500c8c20de7a88bb2b6fda9daea4e0c 444 perl optional libtest-differences-perl_0.47-2maemo1.dsc
+ 5d4abec3fa0e3b9132be533a19c9c7c5 1533 perl optional libtest-differences-perl_0.47-2maemo1.diff.gz
+ fc4ccb5cf64d7d14bebf681c8ac90979 14720 perl optional libtest-differences-perl_0.47-2maemo1_all.deb
diff --git a/deb-src/libtest-differences-perl/libtest-differences-perl_0.47.orig.tar.gz b/deb-src/libtest-differences-perl/libtest-differences-perl_0.47.orig.tar.gz
new file mode 100644 (file)
index 0000000..53dc172
Binary files /dev/null and b/deb-src/libtest-differences-perl/libtest-differences-perl_0.47.orig.tar.gz differ
diff --git a/deb/pool/main/libt/libtest-differences-perl/libtest-differences-perl_0.47-2maemo1_all.deb b/deb/pool/main/libt/libtest-differences-perl/libtest-differences-perl_0.47-2maemo1_all.deb
new file mode 100644 (file)
index 0000000..2ed1b7e
Binary files /dev/null and b/deb/pool/main/libt/libtest-differences-perl/libtest-differences-perl_0.47-2maemo1_all.deb differ
index 3f4e274..ce03a63 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/bash
+#!/bin/bash
 
 help() {
    cat <<EOF