--- a/RegressionTests__DictionaryTest.st Wed Nov 30 13:56:33 2016 +0000
+++ b/RegressionTests__DictionaryTest.st Thu Dec 08 10:28:07 2016 +0000
@@ -28,25 +28,25 @@
testAssociationsSelect
- "(self selector: #testAssociationsSelect) run"
+ "(self selector: #testAssociationsSelect) run"
- | answer d|
+ | answer d|
- d := Dictionary new.
- d at: (Array with: #hello with: #world) put: #fooBar.
- d at: Smalltalk put: #'Smalltalk is the key'.
- d at: #Smalltalk put: Smalltalk.
+ d := Dictionary new.
+ d at: (Array with: #hello with: #world) put: #fooBar.
+ d at: Smalltalk put: #'Smalltalk is the key'.
+ d at: #Smalltalk put: Smalltalk.
- answer := d associationsSelect:
- [:assoc | (assoc key == #Smalltalk) and: [assoc value == Smalltalk]].
- self should: [answer isKindOf: Dictionary].
- self should: [answer size == 1].
- self should: [(answer at: #Smalltalk) == Smalltalk].
+ answer := d associationsSelect:
+ [:assoc | (assoc key == #Smalltalk) and: [assoc value == Smalltalk]].
+ self should: [answer isKindOf: Dictionary].
+ self should: [answer size == 1].
+ self should: [(answer at: #Smalltalk) == Smalltalk].
- answer := d associationsSelect:
- [:assoc | (assoc key == #NoSuchKey) and: [assoc value == #NoSuchValue]].
- self should: [answer isKindOf: Dictionary].
- self should: [answer size == 0]
+ answer := d associationsSelect:
+ [:assoc | (assoc key == #NoSuchKey) and: [assoc value == #NoSuchValue]].
+ self should: [answer isKindOf: Dictionary].
+ self should: [answer size == 0]
!
testComma
@@ -64,18 +64,22 @@
!
testIncludesAssociation
- "self debug: #testIncludesAssociation"
+ "self debug: #testIncludesAssociation"
- | d |
- d := Dictionary new
- at: #five put: 5;
- at: #givemefive put: 5;
- at: #six put: 6;
- yourself.
+ | d |
+ d := Dictionary new
+ at: #five put: 5;
+ at: #givemefive put: 5;
+ at: #six put: 6;
+ yourself.
- self assert: (d includesAssociation: (d associationAt: #five)).
- self assert: (d includesAssociation: (#five -> 5)).
- self assert: (d includesAssociation: (#five -> 6)) not.
+ self assert: (d includesAssociation: (d associationAt: #five)).
+ self assert: (d associationAt: #five) key == #five.
+ self assert: (d associationAt: #five) value == 5.
+ self assert: (d includesAssociation: (#five -> 5)).
+ self assert: (d includesAssociation: (#five -> 6)) not.
+
+ "Modified: / 06-12-2016 / 14:19:15 / cg"
! !
!DictionaryTest class methodsFor:'documentation'!