[squeak-dev] #= ==> #hash issues
David T. Lewis
lewis at mail.msen.com
Fri Oct 26 23:44:28 UTC 2018
Oh my, it sounds like you are tracking down a likely source of very
obscure intermittent bugs. Bravo.
Dave
On Fri, Oct 26, 2018 at 03:21:20PM -0700, Chris Cunningham wrote:
> Hi.
>
> I'm slowly (very) working towards crating a usable test for validating for
> classes where #= is true, #hash will also be true.
>
> Last week, the Date issue showed up. This week?
> Intervals:
> (0 to: 1) = (0 to: 5/3). "true"
> (0 to: 1) hash = (0 to: 5/3) hash. "false"
> CharacterBlock:
> | cb1 cb2 |
> cb1 := (CharacterBlock new stringIndex: 5 text: 'StandardText' asText
> topLeft: (100 at 100) extent: (20 at 20)).
> cb2 := (CharacterBlock new stringIndex: 5 text: 'StandardText' asText
> topLeft: (200 at 200) extent: (20 at 20)).
> cb1 = cb2. "true"
> cb1 hash = cb2 hash. "false"
>
> These were found by comparing a random sampling of instances of classes
> that implement #= or #hash (or both), and finding which have these deviant
> properties. The hard part is figuring out instances that are going to have
> issues - Date didn't show up in my prototype scanning. Also most classes
> don't have instances floating around to compare.
>
> Thanks,
> -cbc
>
More information about the Squeak-dev
mailing list
|