-----BEGIN PGP SIGNED MESSAGE-----

Moin,

On Tuesday 09 September 2003 19:08, Tony Bowden wrote:
> On Tue, Sep 09, 2003 at 05:49:47PM +0100, Fergal Daly wrote:
> Most of the time people shouldn't care. If the thing is sufficiently
> masquerading as a type 5 widget you shouldn't care - that's purely an
> implementation detail.
>
> If you *really* need to care then you should use something other than
> is_deeply.

I agree. For instance, ok() just looks at the outside, and if it compares ok, 
the objects are considered equal. After all, this is the entire point behind 
overloading and tie, to "fake" something. For instance, this "feature" of 
ok() makes it possible to run all Math::BigInt tests with an empty subclass. 
The (from external view) tests should not care whether it is Math::BigInt or 
Math::BigInt::Subclass.

- From my point of view is_deeply() is an extended ok(), which also walks 
arrays, hashes and other (possible nested) structures, and then compares 
_each_ element. If said element is an overloaded/tied object that "fakes" 
some scalar/other object, well, that should be no concern of is_deeply(), 
ok() etc. So, instead of

        foeach (@a)
          {
          is ($a, shift @b, "$a");
          }

you can do

        is_deeply ( [ @a ], [ @b ] );

is_deeply() shouldn't look at the single elements differently than ok() or 
is() do. (Well, my theorie :)

If one wants to test object internas (and it is not clear that you should 
(always? completely?) test them, at least not in the same testfile), then do 
it manually.

After all, if another "fake" implementation comes along, all "external" tests 
should still pass, while the "internal" ones should/would fail. E.g. "$a" is 
still "foo", while ref($a) is not '', but 'Math::String' - outside the same, 
under the hood fundamental different. While *some* test might care, these 
tests are implementation-specific, not behaviour-specific (and are probably 
better taken care of by a specific "per-class" testfile).

Anyway, my 0.02 Eurocent. :-)

Cheers,

Tels

- -- 
 Signed on Tue Sep  9 20:19:35 2003 with key 0x93B84C15.
 PGP key on http://bloodgate.com/tels.asc or per email.

 "Naturally the parameter and boundary of their respective position and
 magnitude are naturally determinable up to the limits of possible
 measurement as stated by the general quantum hypothesis and Heisenberg's
 uncertainty principle, but this indeterminacy in precise value is not a
 consequence of quantum uncertainty. What this illustrates is that in
 relation to indeterminacy in precise physical magnitude, the micro and
 macroscopic are inextricably linked, both being a part of the same parcel,
 rather than just a case of the former underlying and contributing to the
 latter." -- Peter Lynd

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)
Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.

iQEVAwUBP14aoHcLPEOTuEwVAQHNDgf5AUUw0KOsfb1RWSMyrNWjk013M1ri8tDY
o7mhIAftvjEjKSgP3AtSaheM3YP2mvRs2mJIU8OMHXrwBwfO81ZEdevvn+JjKjas
7YtsdV/x6Z5db7mj5vjzbH6KW6sq1ywUblUQZ5EZgrMHNUf5DQR++vIi5Mio2oLE
XKP54/vBw2BpMik9uNqL2Ywb6cCk7nvIDtGT+bhHRfQ+GO2Sn2J/WwomkSX2Ad0y
mPecc9sRBdEX/FpB9LMTakH9GSSmq6s8AgmQSgfAU0zlFsH37Cnskwa05NoYVXwW
OsWeB3NAUw7BhBZIbKaw1Zps/9DtvogII54gE4GCgmL2ynZfKay3lA==
=MrPe
-----END PGP SIGNATURE-----

Reply via email to