~ubuntu-branches/ubuntu/utopic/spamassassin/utopic-proposed

« back to all changes in this revision

Viewing changes to t/sha1.t

  • Committer: Bazaar Package Importer
  • Author(s): Noah Meyerhans
  • Date: 2010-01-26 22:53:12 UTC
  • mfrom: (1.1.13 upstream) (5.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100126225312-wkftb10idc1kz2aq
Tags: 3.3.0-1
* New upstream version.
* Switch to dpkg-source 3.0 (quilt) format

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
use Test;
20
20
use Mail::SpamAssassin;
21
21
 
22
 
use Digest::SHA1;
 
22
BEGIN {
 
23
  eval { require Digest::SHA; import Digest::SHA qw(sha1_hex); 1 }
 
24
  or do { require Digest::SHA1; import Digest::SHA1 qw(sha1_hex) }
 
25
}
23
26
 
24
27
plan tests => 15;
25
28
 
26
29
sub try {
27
30
  my ($data, $want) = @_;
28
31
 
29
 
  if ($want ne Digest::SHA1::sha1_hex($data)) {
30
 
    print "Digest::SHA1 mismatch\n";
 
32
  if ($want ne sha1_hex($data)) {
 
33
    print "Digest::SHA(1) sha1 mismatch\n";
31
34
    return 0;
32
35
  }
33
36
  return 1;