in reply to Need help with module problem specific to sun-solaris

I ran the tests on my Linux from Scratch box, just to see what I got. I'm running Linux 2.4.19 on a P4. The results looked just like yours:
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/cookie......ok + t/function....ok + t/request.....ok + t/simple......FAILED tests 68, 76-77, 81, 89-90, 205 + Failed 7/330 tests, 97.88% okay t/standard....FAILED tests 69, 77-78, 82, 185 + Failed 5/303 tests, 98.35% okay t/util........ok + Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t/simple.t 330 7 2.12% 68 76-77 81 89-90 205 t/standard.t 303 5 1.65% 69 77-78 82 185 Failed 2/6 test scripts, 66.67% okay. 12/839 subtests failed, 98.57% o +kay.


The info that isn't summarized above follows. I've emailed you the dump.txt file as well, but thought for discussion's sake that I should post this here:


For simple.t:
Completed 330 tests 323/330 OK, failed 7/330 97.9% of tests completed successfully, 2.1% failed Please email $VERSION, OS and test numbers failed to jfreeman@tassie.net.au so I can fix them Set $debug = 1 to see where tests are failing $VAR1 = { 'expected' => 'foo bar', 'repetition' => 1, 'todo' => undef, 'result' => 'bar foo', 'package' => 'main' }; $VAR2 = { 'expected' => 'foo=1 bar=2 bar=3 bar=4 = foo=5 bar=6 bar=7 bar=8 = ', 'repetition' => 1, 'todo' => undef, 'result' => 'bar=2 bar=3 bar=4 foo=1 = foo=5 bar=6 bar=7 bar=8 = ', 'package' => 'main' }; $VAR3 = { 'expected' => 'foo bar', 'repetition' => 1, 'todo' => undef, 'result' => 'bar foo', 'package' => 'main' }; $VAR4 = { 'expected' => 'foo bar', 'repetition' => 1, 'todo' => undef, 'result' => 'bar foo', 'package' => 'main' }; $VAR5 = { 'expected' => 'foo=1&bar=2&bar=3&bar=4', 'repetition' => 1, 'todo' => undef, 'result' => 'bar=2&bar=3&bar=4&foo=1', 'package' => 'main' }; $VAR6 = { 'expected' => 'foo=1&bar=2&bar=3&bar=4', 'repetition' => 1, 'todo' => undef, 'result' => 'bar=2&bar=3&bar=4&foo=1', 'package' => 'main' }; $VAR7 = { 'expected' => 'foo bar', 'repetition' => 1, 'todo' => undef, 'result' => 'bar foo', 'package' => 'main' };

For standard.t:
Completed 303 tests 298/303 OK, failed 5/303 98.3% of tests completed successfully, 1.7% failed Please email $VERSION, OS and test numbers failed to jfreeman@tassie.net.au so I can fix them Set $debug = 1 to see where tests are failing $VAR1 = { 'expected' => 'foo bar', 'repetition' => 1, 'todo' => undef, 'result' => 'bar foo', 'package' => 'main' }; $VAR2 = { 'expected' => 'foo=1 bar=2 bar=3 bar=4 = foo=5 bar=6 bar=7 bar=8 = ', 'repetition' => 1, 'todo' => undef, 'result' => 'bar=2 bar=3 bar=4 foo=1 = foo=5 bar=6 bar=7 bar=8 = ', 'package' => 'main' }; $VAR3 = { 'expected' => 'foo bar', 'repetition' => 1, 'todo' => undef, 'result' => 'bar foo', 'package' => 'main' }; $VAR4 = { 'expected' => 'foo bar', 'repetition' => 1, 'todo' => undef, 'result' => 'bar foo', 'package' => 'main' }; $VAR5 = { 'expected' => 'foo bar', 'repetition' => 1, 'todo' => undef, 'result' => 'bar foo', 'package' => 'main' };

--
Love justice; desire mercy.

Replies are listed 'Best First'.
Re: Re: Need help with module problem specific to sun-solaris
by tachyon (Chancellor) on Nov 08, 2002 at 20:17 UTC

    Hmmm. As suspected the failures result from a sort order problem. The interesting thing is that they occur in a seemingly random manner (on most systems they are in one order and OK but on other systems they are broken.) CGI::Simple uses the same method of retaining passed param order as CGI. Params are parsed in the order they are received and the param keys are pushed into an array to remember the order. Specifically this happens

    push @{$self->{'.parameters'}}, $param;

    @.parameters is used to remeber the supplied order. In the test scripts the problem arises thusly:

    # new() hash constructor print "Testing: new() hash constructor\n" if $debug; $q = new CGI::Simple( { 'foo'=>'1', 'bar'=>[2,3,4] } ); @av = $q->param; ok( (join' ',@av), 'foo bar' ); #68

    This is the code for the first test that fails. Evidently on certain versions of perl/OS the bucket architecture changes so that when the hash ref is passed in some cases this code:

    elsif ( (ref $init) =~ m/HASH/i ) { # initialize from param hash for my $param( keys %{$init} ) { $self->_add_param( $param, $init->{$param} ); } }

    returns the keys in a different order. As a result they are pushed into @.parameters in a different order and returned in a different order. Adding a reverse sort at this point will fix the tests BUT as this is exactly the same method CGI uses break concurrence.

    Rather than break this concurrence I will modify the test to reflect the two possible return cases. For all intents and purposes it is unlikey to make any real world difference.

    Thanks very much for your time

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print