<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le sam. 6 avr. 2019 à 15:55, <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/CollectionsTests-nice.304.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk/CollectionsTests-nice.304.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: CollectionsTests-nice.304<br>
Author: nice<br>
Time: 6 April 2019, 3:55:40.624272 pm<br>
UUID: e6dfc4bf-906d-4e7d-8bb4-1fc6fc5bbe4b<br>
Ancestors: CollectionsTests-ul.303<br>
<br>
More and less Interval tests<br>
<br>
- Once upon a time, I changed reversed to answer an Interval, which is a good thing...<br>
  Err, except for Interval of floats (which are generally not well behaved objects)...<br>
  I don't know if we must revert reversed, or hack special case of Float Intervals (I have some idea), but we should at least document the behavior.<br>
<br>
- Once upon a time, I fixed implementation of fuzzy inclusion in Interval. But I don't really approve the feature.<br>
  Fuzzy inclusion produce several unconsistencies in Interval behavior which goes against a principle of least astonishment.<br>
  As we say, you can cheat as long as you don't get caught... Gotcha!<br>
<br>
- Remove testNumericTypes which does not assert anything, which seems to ignore the basics of Smalltalk selector precedence, and which would rely on abandoned equality between Interval and Array.<br>
<br>
=============== Diff against CollectionsTests-ul.303 ===============<br>
<br>
Item was added:<br>
+ ----- Method: IntervalTest>>testIntervalOfFloatReversed (in category 'tests') -----<br>
+ testIntervalOfFloatReversed<br>
+       self assert: (-16.3 to: 20.1 by: 1.3) reversed size<br>
+               equals: (-16.3 to: 20.1 by: 1.3) size<br>
+               description: 'reversed should preserve the size of a collection'.<br>
+       self assert: (0.1 to: 0.9 by: 0.1) reversed asArray<br>
+               equals: (0.1 to: 0.9 by: 0.1) asArray reversed<br>
+               description: 'reversed should preserve the elements of a collection'.!<br>
<br>
Item was removed:<br>
- ----- Method: IntervalTest>>testNumericTypes (in category 'tests') -----<br>
- testNumericTypes<br>
- <br>
-       (3 asNumber) to: 5 = #(3 4 5).<br>
-       <br>
-       3.0 to: 5.0 = #(3.0 4.0 5.0).<br>
-       3.0 to: 5.0 by: 0.5 = #(3.0 3.5 4.0 4.5 5.0).<br>
-       <br>
-       3/1 to: 5/1 = #(3 4 5).<br>
-       1/2 to: 5/2 by: 1/2 = #(1/2 1 3/2 2 5/2).!<br>
<br>
Item was added:<br>
+ ----- Method: IntervalTest>>testSurprisingFuzzyInclusionBehavior (in category 'tests') -----<br>
+ testSurprisingFuzzyInclusionBehavior<br>
+       "If ever Interval implement fuzzy inclusion, then we can expect weird logic..."<br>
+       self assert: ((0.1 to: 0.9 by: 0.1) asArray includes: 0.3)<br></blockquote><div>                                                               ^ oops, this asArray is a slip!<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+                       ==> (((0.1 to: 0.9 by: 0.1) occurrencesOf: 0.3) > 0)<br>
+               description: 'A Collection that includes something has at least one occurrence of something'.<br>
+       self assert: ((0.1 to: 0.9 by: 0.1) lastIndexOf: 0.3)<br>
+                       >= ((0.1 to: 0.9 by: 0.1) indexOf: 0.3)<br>
+               description: 'If the last index of an object in a SequenceableCollection should be greater or equal to the first index'.!<br>
<br>
<br>
</blockquote></div></div>