On Thu, Dec 26, 2002 at 06:27:47PM -0500, Theo Van Dinter wrote:

> Ok, I cleaned up the do_meta code a little bit and added in the
> "strategic" sort. :)

I first tried changing the line

    my @tests = keys %{$self->{conf}{meta_tests}};

to just sort the keys, but that explodes badly -- you pretty much always
want tests starting with __ to run before tests that don't (presumably,
a __ test is intended for later use in another test), but underscores
sort later than letters, so they end up getting run last, which is bad.

So I changed it to this monstrosity:

    my @tests = sort { (my $A = $a) =~ s/^__/@@/;
                       (my $B = $b) =~ s/^__/@@/;
                       $A cmp $B } keys %{$self->{conf}{meta_tests}};

The @ sign is before A in ASCII, so this results in __ tests going
first, and it seems to work.  I can name my meta tests so they run
in the order I want, and nest the results.  It's a little ugly having
all these __A_FOO and __B_BAR tests, but hey. :)

-Jeremy


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to