source: trunk/soft/ObsData/t/OA-03.t @ 169

Last change on this file since 169 was 169, checked in by thauvin, 19 years ago
  • enforce test with use strict, warnings
  • Property cvs2svn:cvs-rev set to 1.3
  • Property svn:keywords set to Author Date Id Revision
  • Property svn:mime-type set to text/x-troff
File size: 636 bytes
Line 
1# $Id$
2
3use strict;
4use warnings;
5
6use Test::More tests => 6;
7use ObsData::Archive;
8use File::Temp qw(tempdir);
9
10my $tempdir = tempdir;
11
12my $oa = ObsData::Archive->new('testdata/coin.gz');
13
14isa_ok($oa, 'ObsData::Archive::Compressed');
15my ($list) = $oa->ls;
16ok($list eq 'coin', "Can list its contents");
17
18ok($oa->extract('coin', "$tempdir/coin"), "Can extract the file");
19ok(-r "$tempdir/coin", "the file has been really extract");
20
21$oa = ObsData::Archive->new('testdata/wrongcoin.gz');
22ok(!$oa->extract('wrongcoin', "$tempdir/coin"), "Get an error if extraction failed");
23ok($oa->error, "Can get error");
24
25system(qw(rm -fr), $tempdir);
Note: See TracBrowser for help on using the repository browser.