<div dir="ltr"><div><div><div>While at it, there were a discussion in Pharo about shouldnt: [] raise: Error, and it's generally considered a poor test<br></div>- practically nothing should raise Error, unless in the few cases when you create a block that should:raise:<br>
</div><div> so should:raise: is usefull, but shouldnt:raise: is generally useless<br> (unless maybe if you are testing an Error inhibition mechanism with a block that shouldNormally:raise: Error)<br></div>- if ever, it effectively raises an Error, you have no information why<br>
</div>I fully agree with this.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/4 <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Frank Shearar uploaded a new version of CollectionsTests to project The 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 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: Error.<br>
+ self assert: (ba longAt: 1 bigEndian: true) = value.<br>
+ self shouldnt:[ba longAt: 1 put: value bigEndian: false] raise: Error.<br>
+ self assert: (ba longAt: 1 bigEndian: false) = value.!<br>
<br>
Item was added:<br>
+ ----- Method: DictionaryTest>>testIntegrityOfDictionaries (in category 'integrity tests') -----<br>
+ testIntegrityOfDictionaries<br>
+ #(<br>
+ Dictionary<br>
+ IdentityDictionary<br>
+ SystemDictionary<br>
+ LiteralDictionary<br>
+ PluggableDictionary<br>
+ WeakValueDictionary) do: [ :dictionaryClassName |<br>
+ Smalltalk at: dictionaryClassName ifPresent: [ :dictionaryClass |<br>
+ dictionaryClass allInstancesDo: [ :dictionary |<br>
+ dictionary keysAndValuesDo: [ :key :value |<br>
+ self assert: (dictionary at: key) == value ].<br>
+ dictionary array doWithIndex: [ :association :index |<br>
+ association ifNotNil: [<br>
+ self assert: (dictionary scanFor: association key) = index ] ] ] ] ]!<br>
<br>
Item was added:<br>
+ ----- Method: DictionaryTest>>testMethodDictionaries (in category '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 at: index) isNil ]<br>
+ ifNotNil: [ :key |<br>
+ self assert: (dictionary scanFor: key) = index ] ] ]!<br>
<br>
Item was added:<br>
+ ----- Method: HashedCollectionTest>>testCapacity (in category 'test - integrity') -----<br>
+ testCapacity<br>
+<br>
+ | inconsistentCollections |<br>
+ inconsistentCollections := HashedCollection allSubInstances reject: [ :each |<br>
+ each class == MethodDictionary "MethodDictionary is the 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 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>
</blockquote></div><br></div>