You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Daniel Quinlan <qu...@pathname.com> on 2004/01/30 03:07:33 UTC

Re: svn commit: rev 6352 - in incubator/spamassassin/trunk: . t

Review needed here.

These changes are totally unnecessary (these cases are already covered)
and the self-referential quoting is a bit much.  The Habeas string was
added as a paranoia check beyond the binary tests because we use SHA1 on
the transformed version in our code.

- Daniel

felicity@apache.org writes:

> Modified: incubator/spamassassin/trunk/t/sha1.t
> ==============================================================================
> --- incubator/spamassassin/trunk/t/sha1.t	(original)
> +++ incubator/spamassassin/trunk/t/sha1.t	Thu Jan 29 11:43:38 2004
> @@ -22,7 +22,7 @@
>  use Mail::SpamAssassin::SHA1;
>  use constant HAS_DIGEST_SHA1 => eval { require Digest::SHA1; };
>  
> -plan tests => 15;
> +plan tests => 18;
>  
>  sub try {
>    my ($data, $want) = @_;
> @@ -57,7 +57,7 @@
>    return $string;
>  }
>  
> -my $habeas = <<END;
> +my $text_blob = <<END;
>  X-Habeas-SWE-1: winter into spring
>  X-Habeas-SWE-2: brightly anticipated
>  X-Habeas-SWE-3: like Habeas SWE (tm)
> @@ -69,9 +69,16 @@
>  X-Habeas-SWE-9: mark in spam to <http://www.habeas.com/report/>.
>  END
>  
> -$habeas =~ tr/A-Z/a-z/;
> -$habeas =~ tr/ / /s;
> -$habeas =~ s/\/?>/\/>/;
> +$text_blob =~ tr/A-Z/a-z/;
> +$text_blob =~ tr/ / /s;
> +$text_blob =~ s/\/?>/\/>/;
> +
> +# check the valid one
> +ok(try($text_blob, "42ab3d716380503f66c4d44017c7f37b04458a9a"));
> +
> +# check an invalid one
> +$text_blob =~ s/0/O/;
> +ok(!try($text_blob, "42ab3d716380503f66c4d44017c7f37b04458a9a"));
>  
>  # fixed strings
>  ok(try("squeamish ossifrage\n", "820550664cf296792b38d1647a4d8c0e1966af57"));
> @@ -79,6 +86,28 @@
>  ok(try("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
>         "84983e441c3bd26ebaae4aa1f95129e5e54670f1"));
>  
> +# longest word in the english language ...
> +ok(try("pneuminoultramicroscopicosilicovolcanokoniosis", "6cd152f7a76fb5c2717cee2fdf9c0cdca798cd33"));
> +
> +
> +$text_blob = <<END;
> +"I wonder if they'd use a cow as a heat shield for a space rocket...  Make it
> +kind of like a barbeque...  They can land in the ocean, get out, and have
> +some hamburgers...  They can mingle and wait for the Navy to arrive..." - Theo
> +END
> +
> +ok(try($text_blob, '65aaa454875b1a5342ecdfe41786117201126aad'));
> +
> +$text_blob .= <<END;
> + if you're happy and you know it eat some spam.    
> + if your arteries aren't congested have some ham.
> + if you're happy and you know it and your cholesterol isn't bloated have some
> +  ham and eggs and bacon while you can.         
> +END
> +
> +ok(!try($text_blob, '65aaa454875b1a5342ecdfe41786117201126aad'));
> +
> +
>  # garbled strings
>  ok(try(string(287, 1), "909f99a779adb66a76fc53ab56c7dd1caf35d0fd"));
>  ok(try(string(648, 16), "44793ba2b430507c5be08165e5b003977e31d0b2"));
> @@ -91,9 +120,3 @@
>  ok(try(string(367, 51474), "15201559b3ffb278918a2f7a35d2b702a72fb391"));
>  ok(try(string(504, 64273), "73e56c49eecef44a53048e27baa42e491375eb23"));
>  
> -# habeas
> -ok(try($habeas, "42ab3d716380503f66c4d44017c7f37b04458a9a"));
> -
> -# anti-habeas
> -$habeas =~ s/0/O/;
> -ok(!try($habeas, "42ab3d716380503f66c4d44017c7f37b04458a9a"));
>