Bug#523515: test suite

Stephen Gran sgran at debian.org
Sat Apr 11 14:05:05 UTC 2009


I thought I'd just provide the test suite that I was using to validate
the last patch set:

steve at siberia:~$ touch foo bar
steve at siberia:~$ cat t.pl
#!/usr/bin/perl
use strict;
use warnings;
use Archive::Ar;
use Data::Dumper;

my $ar = Archive::Ar->new();
for my $t (qw(foo bar)) {
  $ar->add_files($t);
}

my $arname = "foo.ar";
$ar->write($arname);
system("ar", "tv", $arname);

for my $t (qw(foo bar)) {
  my $content = $ar->get_content($t);
  print Dumper $content;
}

Produces this output with the installed Archive::Ar and the locally modified
copy, respectively:

steve at siberia:~$ perl t.pl 
-wx-wx--x 1001/1001      0 Apr 11 14:48 2009 foo
-wx-wx--x 1001/1001      0 Apr 11 14:48 2009 bar
$VAR1 = {
          'uid' => 1001,
          'mode' => 33188,
          'date' => 1239457687,
          'name' => 'foo',
          'data' => '',
          'size' => 0,
          'gid' => 1001
        };
$VAR1 = {
          'uid' => 1001,
          'mode' => 33188,
          'date' => 1239457687,
          'name' => 'bar',
          'data' => '',
          'size' => 0,
          'gid' => 1001
        };
steve at siberia:~$ perl -Ilib t.pl 
rw-r--r-- 1001/1001      0 Apr 11 14:48 2009 foo
rw-r--r-- 1001/1001      0 Apr 11 14:48 2009 bar
$VAR1 = {
          'uid' => 1001,
          'mode' => 33188,
          'date' => 1239457687,
          'name' => 'foo',
          'data' => '',
          'size' => 0,
          'gid' => 1001
        };
$VAR1 = {
          'uid' => 1001,
          'mode' => 33188,
          'date' => 1239457687,
          'name' => 'bar',
          'data' => '',
          'size' => 0,
          'gid' => 1001
        };

Cheers,
-- 
 -----------------------------------------------------------------
|   ,''`.                                            Stephen Gran |
|  : :' :                                        sgran at debian.org |
|  `. `'                        Debian user, admin, and developer |
|    `-                                     http://www.debian.org |
 -----------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20090411/0c7032b6/attachment.pgp>


More information about the pkg-perl-maintainers mailing list