Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DateTime CPAN distribution.

Report information
The Basics
Id: 55606
Status: resolved
Priority: 0/
Queue: DateTime

People
Owner: Nobody in particular
Requestors: zefram [...] fysh.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.55



Subject: dodgy sort test for DateTime
Date: Mon, 15 Mar 2010 20:19:11 +0000
To: bug-DateTime [...] rt.cpan.org
From: Zefram <zefram [...] fysh.org>
In DateTime-0.54, the test script t/29overload.t has a test of cmp overloading, via sort, that is liable to fail because the correct output of the sort is not fully determined. A DateTime object and a string representing the same date are expected to sort equally, so may appear in either order in the output from sort. False test failures arise if they appear in the opposite order from the supplied `expected' output. Attached patch fixes by flattening all the values to plain strings. -zefram

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #55606] dodgy sort test for DateTime
Date: Mon, 15 Mar 2010 15:24:14 -0500 (CDT)
To: Zefram via RT <bug-DateTime [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Mon, 15 Mar 2010, Zefram via RT wrote: Show quoted text
> In DateTime-0.54, the test script t/29overload.t has a test of cmp > overloading, via sort, that is liable to fail because the correct output > of the sort is not fully determined. A DateTime object and a string > representing the same date are expected to sort equally, so may appear > in either order in the output from sort. False test failures arise if > they appear in the opposite order from the supplied `expected' output. > Attached patch fixes by flattening all the values to plain strings.
I didn't add this test (it came from a patch), but I think flattening the values like this may somewhat defeat the purpose of the test. Maybe it'd be better to add a secondary sort based on whether or not the value is an object? -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/