~ubuntu-branches/ubuntu/precise/bioperl/precise

« back to all changes in this revision

Viewing changes to t/Root/Utilities.t

  • Committer: Bazaar Package Importer
  • Author(s): Ilya Barygin
  • Date: 2010-01-27 22:48:22 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100127224822-ebot4qbrjxcv38au
Tags: 1.6.1-1ubuntu1
* Merge from Debian testing, remaining changes:
  - disable tests, they produce a FTBFS trying to access the network 
    during run.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*-Perl-*- Test Harness script for Bioperl
2
 
# $Id: Utilities.t 15112 2008-12-08 18:12:38Z sendu $
 
2
# $Id: Utilities.t 16168 2009-09-25 21:07:32Z cjfields $
3
3
 
4
4
 
5
5
use strict;
8
8
    use lib '.';
9
9
    use Bio::Root::Test;
10
10
    
11
 
    test_begin(-tests => 50);
 
11
    test_begin(-tests => 56);
12
12
    
13
13
        use_ok('Bio::Root::Utilities');
14
14
}
51
51
# file_date(), file_flavor(), date_format()
52
52
 
53
53
my $file = test_input_file('test.txt');
 
54
my $file2 = test_input_file('test 2.txt');
54
55
my $fdate = $u->file_date($file);
55
56
like $fdate ,  qr/\d{4}-\d{2}-\d{2}/, 'file_date()';
56
57
ok $u->file_flavor($file), 'unix (\n or 012 or ^J)';
74
75
# compress() and uncompress() using gzip.
75
76
SKIP: {
76
77
    my $gzip = $u->find_exe('gzip');
77
 
    skip "gzip not found, skipping gzip tests", 6 unless $gzip;
 
78
    skip "gzip not found, skipping gzip tests", 12 unless $gzip;
78
79
    ok -x $gzip;
79
80
    
 
81
    # test compression/decompression of a simple file
80
82
    my $zfile = $u->compress($file);
81
83
    like $zfile, qr/$file.gz|tmp.bioperl.gz/;
82
84
    ok -s $zfile;
89
91
    my $unzfile = $u->uncompress($zfile);
90
92
    ok ! -e $zfile;
91
93
    ok -e $file;
 
94
 
 
95
    # test compression/decompression of a filename with spaces keeping the original intact
 
96
    my $zfile2 = $file2.'.gz';
 
97
    my $return = $u->compress(-file => $file2, -outfile => $zfile2, -tmp => 1);
 
98
    is $return, $zfile2;
 
99
    ok -e $zfile2;
 
100
    ok -e $file2;
 
101
    unlink $file2 or die "Problem deleting $file2: $!\n";
 
102
    $return = $u->uncompress(-file => $zfile2, -outfile => $file2, -tmp => 1);
 
103
    is $return, $file2;
 
104
    ok -e $file2;
 
105
    ok -e $zfile2;
 
106
    unlink $zfile2 or die "Problem deleting $zfile2: $!\n";
92
107
}
93
108
 
94
109
# send_mail()