<div dir="ltr">Sure! I said while at it ;)<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/4 Frank Shearar <span dir="ltr"><<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes. #shouldnt:raise: is evil when you catch Error.<br>
<br>
I deliberately didn't do that here so that reviewers could see that I<br>
moved methods, not added some random new test.<br>
<br>
frank<br>
<br>
On 4 November 2013 20:56, Nicolas Cellier<br>
<div class="HOEnZb"><div class="h5"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<br>
> While at it, there were a discussion in Pharo about shouldnt: [] raise:<br>
> Error, and it's generally considered a poor test<br>
> - practically nothing should raise Error, unless in the few cases when you<br>
> create a block that should:raise:<br>
> so should:raise: is usefull, but shouldnt:raise: is generally useless<br>
> (unless maybe if you are testing an Error inhibition mechanism with a<br>
> block that shouldNormally:raise: Error)<br>
> - if ever, it effectively raises an Error, you have no information why<br>
> I fully agree with this.<br>
><br>
><br>
> 2013/11/4 <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>><br>
><br>
>> Frank Shearar uploaded a new version of CollectionsTests to project The<br>
>> Trunk:<br>
>> <a href="http://source.squeak.org/trunk/CollectionsTests-fbs.207.mcz" target="_blank">http://source.squeak.org/trunk/CollectionsTests-fbs.207.mcz</a><br>
>><br>
>> ==================== Summary ====================<br>
>><br>
>> Name: CollectionsTests-fbs.207<br>
>> Author: fbs<br>
>> Time: 4 November 2013, 6:31:01.83 pm<br>
>> UUID: 4057d67b-5969-8b41-85d1-43fd39da4bb1<br>
>> Ancestors: CollectionsTests-cmm.206<br>
>><br>
>> Move collection tests where they belong.<br>
>><br>
>> =============== Diff against CollectionsTests-cmm.206 ===============<br>
>><br>
>> Item was added:<br>
>> + ----- Method: ByteArrayTest>>testByteArrayLongAt (in category 'as yet<br>
>> unclassified') -----<br>
>> + testByteArrayLongAt<br>
>> + | ba value |<br>
>> + ba := ByteArray new: 4.<br>
>> + value := -1.<br>
>> + self shouldnt:[ba longAt: 1 put: value bigEndian: true] raise:<br>
>> Error.<br>
>> + self assert: (ba longAt: 1 bigEndian: true) = value.<br>
>> + self shouldnt:[ba longAt: 1 put: value bigEndian: false] raise:<br>
>> Error.<br>
>> + self assert: (ba longAt: 1 bigEndian: false) = value.!<br>
>><br>
>> Item was added:<br>
>> + ----- Method: DictionaryTest>>testIntegrityOfDictionaries (in category<br>
>> 'integrity tests') -----<br>
>> + testIntegrityOfDictionaries<br>
>> + #(<br>
>> + Dictionary<br>
>> + IdentityDictionary<br>
>> + SystemDictionary<br>
>> + LiteralDictionary<br>
>> + PluggableDictionary<br>
>> + WeakValueDictionary) do: [ :dictionaryClassName |<br>
>> + Smalltalk at: dictionaryClassName ifPresent: [<br>
>> :dictionaryClass |<br>
>> + dictionaryClass allInstancesDo: [<br>
>> :dictionary |<br>
>> + dictionary keysAndValuesDo: [ :key<br>
>> :value |<br>
>> + self assert: (dictionary<br>
>> at: key) == value ].<br>
>> + dictionary array doWithIndex: [<br>
>> :association :index |<br>
>> + association ifNotNil: [<br>
>> + self assert: (dictionary<br>
>> scanFor: association key) = index ] ] ] ] ]!<br>
>><br>
>> Item was added:<br>
>> + ----- Method: DictionaryTest>>testMethodDictionaries (in category<br>
>> 'integrity tests') -----<br>
>> + testMethodDictionaries<br>
>> + MethodDictionary allInstancesDo: [ :dictionary |<br>
>> + dictionary keysAndValuesDo: [ :key :value |<br>
>> + self assert: (dictionary at: key) == value ].<br>
>> + 1 to: dictionary basicSize do: [ :index |<br>
>> + (dictionary basicAt: index)<br>
>> + ifNil: [ self assert: (dictionary array<br>
>> at: index) isNil ]<br>
>> + ifNotNil: [ :key |<br>
>> + self assert: (dictionary scanFor:<br>
>> key) = index ] ] ]!<br>
>><br>
>> Item was added:<br>
>> + ----- Method: HashedCollectionTest>>testCapacity (in category 'test -<br>
>> integrity') -----<br>
>> + testCapacity<br>
>> +<br>
>> + | inconsistentCollections |<br>
>> + inconsistentCollections := HashedCollection allSubInstances<br>
>> reject: [ :each |<br>
>> + each class == MethodDictionary "MethodDictionary is the<br>
>> only HashedCollection which doesn't have prime array size"<br>
>> + ifTrue: [ each capacity isPowerOfTwo ]<br>
>> + ifFalse: [ each capacity isPrime ] ].<br>
>> + self assert: inconsistentCollections isEmpty!<br>
>><br>
>> Item was added:<br>
>> + ----- Method: ReadWriteStreamTest>>testReadWriteStreamNextNBug (in<br>
>> category 'tests') -----<br>
>> + testReadWriteStreamNextNBug<br>
>> + | aStream |<br>
>> + aStream := ReadWriteStream on: String new.<br>
>> + aStream nextPutAll: 'Hello World'.<br>
>> + self shouldnt:[aStream next: 5] raise: Error.!<br>
>><br>
>><br>
><br>
><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>