mmm.. I been bit by this, but I think it's what you could call a bug in the Test::More docs.. maybe, depending on how you read it..

"This is a deep check, but the irrelevancy of order only applies to the top level."

Basically, the test below shows that order doesn't matter for a shallow test, but once you have more than the "top level", order does matter.

#!/usr/bin/perl use Test::More qw(no_plan); my (@this,@that); @this = ('Fred','Wilma'); @that = ('Fred','Wilma'); ok(eq_set(\@this, \@that), 'Shallow Order Same'); @this = ('Fred','Wilma'); @that = ('Wilma','Fred'); ok(eq_set(\@this, \@that), 'Shallow Order Diff'); @this = ( { fred => 1 }, { wilma => 1 } ); @that = ( { fred => 1 }, { wilma => 1 } ); ok(eq_set(\@this, \@that), 'Deep Order Same'); @this = ( { fred => 1 }, { wilma => 1 } ); @that = ( { wilma => 1 }, { fred => 1 } ); ok(eq_set(\@this, \@that), 'Deep Order Diff'); __END__ prints: ok 1 - Shallow Order Same ok 2 - Shallow Order Diff ok 3 - Deep Order Same not ok 4 - Deep Order Diff # Failed test (testmore.pl at line 21) 1..4 # Looks like you failed 1 tests of 4.

cheers,

J


In reply to Re: Test::More - equal_set by edoc
in thread Test::More - equal_set by brewer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.