develooper Front page | perl.perl5.porters | Postings from October 2008

[ANNOUNCE] Test::More/Simple/Builder 0.85_01 (cmp_ok() fixagewarning)

Michael G Schwern
October 23, 2008 19:15
[ANNOUNCE] Test::More/Simple/Builder 0.85_01 (cmp_ok() fixagewarning)
Message ID:

This latest release resolves a number of long outstanding issues in cmp_ok().
 The biggest being this:

    cmp_ok $object, '==', $number;

cmp_ok() would always stringify or numify its arguments, removing the
overloading.  This meant that if $object had '==' overloaded it was not being

The best example in the wild is DateTime which overloads '==' but disallows a
numeric representation.

  use Test::More tests => 1;
  use DateTime;
  cmp_ok( DateTime->now, "==", DateTime->now )

Previous versions yielded this:

Cannot add 0 to a DateTime object (DateTime=HASH(0x190c740)).
 Only a DateTime::Duration object can  be added to a DateTime object. at
/Users/schwern/releases/Test-Simple-0.80/lib//Test/ line 501
# Looks like your test died before it could output anything.

which was Test::Builder trying to "unoverload" the object.  This latest
release compares them fine.

I expect this to cause a bit of fixage.

0.85_01  Thu Oct 23 18:57:38 PDT 2008
    New Features
    * cmp_ok() now displays the error if the comparison throws one.
      For example, broken overloaded objects.

    Bug Fixes
    * cmp_ok() no longer stringifies or numifies its arguments before comparing.
      This makes cmp_ok() properly test overloaded ops.
      [ 24186] [ 16]
    * diag() properly escapes blank lines.

    Feature Changes
    * cmp_ok() now reports warnings and errors as coming from inside cmp_ok,
      as well as reporting the caller's file and line.  This let's the user
      know where cmp_ok() was called from while reminding them that it is
      being run in a different context.

    * Dependency on ExtUtils::MakeMaker 6.27 only on Windows otherwise the
      nested tests won't run.

0.84  Wed Oct 15 09:06:12 EDT 2008
    * 0.82 accidentally shipped with experimental Mouse dependency.

0.82  Tue Oct 14 23:06:56 EDT 2008
    Bug Fixes
    - 0.81_01 broke $TODO such that $TODO = '' was considered todo.

52. Not allowed to yell "Take that Cobra" at the rifle range.
    -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
  Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About