~ubuntu-branches/ubuntu/maverick/ciphersaber/maverick

« back to all changes in this revision

Viewing changes to t/bigfile.t

  • Committer: Bazaar Package Importer
  • Author(s): Jerome Marant
  • Date: 2002-03-27 07:23:42 UTC
  • Revision ID: james.westby@ubuntu.com-20020327072342-zcvplihmsszct2ok
Tags: upstream-0.60
ImportĀ upstreamĀ versionĀ 0.60

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# test to see if we can decrypt files via filehandles 
 
2
# this tests for a subtle bug, ie, missing a modulo on $i
 
3
 
 
4
use Crypt::CipherSaber;
 
5
use File::Spec;
 
6
 
 
7
print "1..1\n";
 
8
 
 
9
my $cs = new Crypt::CipherSaber ('sdrawkcabsihtdaeR');
 
10
open(INPUT, File::Spec->catfile('t', 'smiles.cs1')) or die "Couldn't open: $!";
 
11
binmode(INPUT);
 
12
open(OUTPUT, '>' . File::Spec->catfile('t', 'smiles.png')) 
 
13
        or die "Couldn't open: $!";
 
14
binmode(OUTPUT);
 
15
$cs->fh_crypt(\*INPUT, \*OUTPUT);
 
16
close INPUT;
 
17
close OUTPUT;
 
18
 
 
19
open(TEST, File::Spec->catfile('t', 'smiles.png')) or die "Couldn't open: $!";
 
20
my $line = <TEST>;
 
21
 
 
22
if ($line =~ /PNG/) {
 
23
        print "ok 1\n";
 
24
} else {
 
25
        print "not ok 1\n";
 
26
}