<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Chris,<div><br><div class="gmail_quote"><div dir="ltr">On Sun, Oct 28, 2018 at 5:13 PM <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Chris Cunningham uploaded a new version of CollectionsTests to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/CollectionsTests-cbc.296.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/CollectionsTests-cbc.296.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: CollectionsTests-cbc.296<br>
Author: cbc<br>
Time: 28 October 2018, 5:12:30.875512 pm<br>
UUID: 12a1d6bf-85c7-8d40-aa1c-022556c1cb18<br>
Ancestors: CollectionsTests-topa.295<br>
<br>
Test for #hash and #= bugs.  In anticipation of fixing these.<br>
<br>
=============== Diff against CollectionsTests-topa.295 ===============<br>
<br>
Item was added:<br>
+ ----- Method: IntervalTest>>testHashBug3380 (in category 'tests') -----<br>
+ testHashBug3380<br>
+       "Array and Interval equate, but their hashes didn't.  Test that this is fixed.<br>
+       It is about mantis bug <a href="http://bugs.squeak.org/view.php?id=6455" rel="noreferrer" target="_blank">http://bugs.squeak.org/view.php?id=6455</a>"<br>
+       | interval array |<br>
+       interval := (1 to: 3).<br>
+       array:= #(1 2 3).<br>
+       self assert: interval equals: array.<br></blockquote><div><br></div><div>At least for me I don't see why this should be true.  We have hasEqualElements: for this, so</div><div><br></div><div><div>SequenceableCollection allSubclasses select:</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>[:c|</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>[(#(1 2 3) as: c) = #(1 2 3)] on: Error do: [:ex| false]]</div><div>an OrderedCollection(LinkedList Interval RunArray Array Mutex WeakArray Monitor)</div></div><div><br></div><div>SequenceableCollection allSubclasses reject:</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">       </span>[:c|</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>[(#(1 2 3) as: c) = #(1 2 3)] on: Error do: [:ex| true]] an OrderedCollection(OrderedCollection SourceFileArray SoundBuffer WordArray ShortIntegerArray Bitmap FloatArray ShortRunArray ByteArray IntegerArray SparseLargeTable PredicatedArray DoubleByteArray DoubleWordArray Semaphore SortedCollection GraphicSymbol UrlArgumentList TraitComposition ObjectFinalizerCollection WeakOrderedCollection StandardSourceFileArray ExpandedSourceFileArray WordArrayForSegment ActionSequence WeakActionSequence Cubic KedamaFloatArray SocketAddress SparseLargeArray FloatCollection WeakActionSequenceTrappingErrors) </div><div><br></div><div>SequenceableCollection allSubclasses reject:<br></div><div><div><span class="gmail-Apple-tab-span" style="white-space:pre">     </span>[:c|</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>[(#(1 2 3) as: c) hasEqualElements: #(1 2 3)] on: Error do: [:ex| true]] an OrderedCollection(SoundBuffer ShortIntegerArray)</div></div><div><br></div><div>i.e. there are many SequenceableCollection subclasses, including OrderedCollection, and all the integer arrays (ByteArray through DoubleWordArray) that are not #= to an equivalent integer array.</div><div><br></div><div>I would throw out the assumption that intervals and arrays are equal; as long as hasEqualElements: answers true things are good, no?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
+       self assert: interval hash equals: array hash.!<br>
<br>
Item was added:<br>
+ ----- Method: IntervalTest>>testHashEqualIfIntervalEqual (in category 'tests') -----<br>
+ testHashEqualIfIntervalEqual<br>
+       | interval1 interval2 |<br>
+       interval1 := 0 to: 1.<br>
+       interval2 := 0 to: 5/3. "Taken from an actual issue in an image"<br>
+       self assert: interval1 equals: interval2.<br>
+       self assert: interval1 hash equals: interval2 hash.!<br>
<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></div></div></div></div></div></div></div>