r27363 - in /trunk/dh-make-perl: dh-make-perl t/AptContents.t

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Fri Nov 28 07:23:41 UTC 2008


Author: dmn
Date: Fri Nov 28 07:23:33 2008
New Revision: 27363

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=27363
Log:
AptContents: allow object creation with no contents

This allows testing of the various methods even in situations when
no contents files was found

main dh-make-perl still undef's $apt_contents where no cache is found

Modified:
    trunk/dh-make-perl/dh-make-perl
    trunk/dh-make-perl/t/AptContents.t

Modified: trunk/dh-make-perl/dh-make-perl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/dh-make-perl?rev=27363&op=diff
==============================================================================
--- trunk/dh-make-perl/dh-make-perl (original)
+++ trunk/dh-make-perl/dh-make-perl Fri Nov 28 07:23:33 2008
@@ -126,7 +126,6 @@
     $self->verbose(1) unless defined( $self->verbose );
 
     $self->read_cache();
-    $self->cache or return undef;
 
     return $self;
 }
@@ -610,6 +609,8 @@
     sources_file => $opt_sources_list,
     verbose      => $opt_verbose,
 });
+
+undef($apt_contents) unless $apt_contents->cache;
 
 push @depends, Dep->new('${shlib:Depends}') if $arch eq 'any';
 push @depends, Dep->new('${misc:Depends}');

Modified: trunk/dh-make-perl/t/AptContents.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/t/AptContents.t?rev=27363&op=diff
==============================================================================
--- trunk/dh-make-perl/t/AptContents.t (original)
+++ trunk/dh-make-perl/t/AptContents.t Fri Nov 28 07:23:33 2008
@@ -29,14 +29,13 @@
 
 my $apt_contents = instance( contents_dir => 'non-existent' );
 
-is( $apt_contents, undef, 'should not create with no contents' );
+isnt( $apt_contents, undef, 'should create with no contents' );
 
-$apt_contents = instance( dist => 'non-existent' );
-is( $apt_contents, undef, 'should not create when no dists found' );
+is( $apt_contents->cache, undef, 'but should contain no cache' );
+
+is( $apt_contents->cache, undef, 'should have no cache when no dists found' );
 
 $apt_contents = instance();
-
-isnt( $apt_contents, undef, 'object created' );
 
 is_deeply(
     $apt_contents->contents_files,




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