1 RegressionTests definePrototype: #CollectionHash &basis: TestCase.
2 "Checks whether hash value for collections with same elements is equal."
4 t@(RegressionTests CollectionHash traits) testCollection: c1 against: c2
7 description: c1 printString ; ' and ' ; c2 printString ; ' are not equal.'.
8 t assert: c1 hash = c2 hash
9 description: c1 printString ; ' and ' ; c2 printString ; ' hashes differ.'
12 t@(RegressionTests CollectionHash traits) testCollection
14 c1 ::= Set newWith: #a.
15 c2 ::= Set newWith: #a.
16 t testCollection: c1 against: c2.
18 { 1. 16r10000000. #a. 'string'. {0. 2}. Set. 0. 2. 3. 4. 5. 6. 7. 8.
19 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20 } do:
20 [| :e | c1 include: e. c2 include: e].
21 t testCollection: c1 against: c2
24 t@(RegressionTests CollectionHash traits) testSequence
26 s1 := {0. 1. 2. #a. 'foo'}.
27 s2 := {0. 1. 2. #a. 'foo'}.
28 t testCollection: s1 against: s2.
30 s1 := s1 as: ExtensibleArray.
31 s2 := s2 as: ExtensibleArray.
32 s1 addAll: {{}. #k. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0}.
33 s2 addAll: {{}. #k. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0}.
34 t testCollection: s1 against: s2.
37 t@(RegressionTests CollectionHash traits) suite
38 [t suiteForSelectors: {
43 RegressionTests definePrototype: #ExtSeqWriter &basis: TestCase.
44 "Checks whether writer iterator of ExtensibleSequence is actually able to
47 t@(RegressionTests ExtSeqWriter traits) testWriting
49 s ::= ExtensibleArray new.
51 w ; {#a. 0. {}. lobby}.
52 t assert: w contents = s.
56 t@(RegressionTests ExtSeqWriter traits) suite
57 [t suiteForSelectors: {