RegressionTests__DictionaryTest.st
changeset 2343 f639bb06d701
parent 2166 a93ab3a63417
equal deleted inserted replaced
2342:18fae254e775 2343:f639bb06d701
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "{ Package: 'stx:goodies/regression' }"
     3 "{ Package: 'stx:goodies/regression' }"
     2 
     4 
     3 "{ NameSpace: RegressionTests }"
     5 "{ NameSpace: RegressionTests }"
     4 
     6 
     5 TestCase subclass:#DictionaryTest
     7 TestCase subclass:#DictionaryTest
    19     "Created: / 14-09-2018 / 16:38:30 / Stefan Vogel"
    21     "Created: / 14-09-2018 / 16:38:30 / Stefan Vogel"
    20 ! !
    22 ! !
    21 
    23 
    22 !DictionaryTest methodsFor:'testing'!
    24 !DictionaryTest methodsFor:'testing'!
    23 
    25 
    24 testAddAll
    26 test01_AddAll
    25         "(self run: #testAddAll)"
    27         "(self run: #testAddAll)"
    26 
    28 
    27         | dict1 dict2 |
    29         | dict1 dict2 |
    28         dict1 := dictionaryClass new.
    30         dict1 := dictionaryClass new.
    29         dict1 at: #a put:1 ; at: #b put: 2.
    31         dict1 at: #a put:1 ; at: #b put: 2.
    35         self assert: (dict1 at: #c) = 4.
    37         self assert: (dict1 at: #c) = 4.
    36 
    38 
    37     "Modified: / 14-09-2018 / 16:38:54 / Stefan Vogel"
    39     "Modified: / 14-09-2018 / 16:38:54 / Stefan Vogel"
    38 !
    40 !
    39 
    41 
    40 testAssociationsSelect
    42 test02_AssociationsSelect
    41 
    43 
    42         "(self selector: #testAssociationsSelect) run"
    44         "(self selector: #testAssociationsSelect) run"
    43 
    45 
    44         | answer d|
    46         | answer d|
    45 
    47 
    60         self should: [answer size == 0]
    62         self should: [answer size == 0]
    61 
    63 
    62     "Modified: / 14-09-2018 / 16:39:05 / Stefan Vogel"
    64     "Modified: / 14-09-2018 / 16:39:05 / Stefan Vogel"
    63 !
    65 !
    64 
    66 
    65 testComma
    67 test03_Comma
    66         "(self run: #testComma)"
    68         "(self run: #testComma)"
    67 
    69 
    68         | dict1 dict2 dict3 |
    70         | dict1 dict2 dict3 |
    69         dict1 := dictionaryClass new.
    71         dict1 := dictionaryClass new.
    70         dict1 at: #a put:1 ; at: #b put: 2.
    72         dict1 at: #a put:1 ; at: #b put: 2.
    76         self assert: (dict3 at: #c) = 4.
    78         self assert: (dict3 at: #c) = 4.
    77 
    79 
    78     "Modified: / 14-09-2018 / 16:39:14 / Stefan Vogel"
    80     "Modified: / 14-09-2018 / 16:39:14 / Stefan Vogel"
    79 !
    81 !
    80 
    82 
    81 testIncludesAssociation
    83 test04_IncludesAssociation
    82         "self debug: #testIncludesAssociation"
    84         "self debug: #testIncludesAssociation"
    83 
    85 
    84         | d |
    86         | d |
    85         d := dictionaryClass new
    87         d := dictionaryClass new
    86                 at: #five put: 5;
    88                 at: #five put: 5;
    96 
    98 
    97     "Modified: / 06-12-2016 / 14:19:15 / cg"
    99     "Modified: / 06-12-2016 / 14:19:15 / cg"
    98     "Modified: / 14-09-2018 / 16:39:21 / Stefan Vogel"
   100     "Modified: / 14-09-2018 / 16:39:21 / Stefan Vogel"
    99 !
   101 !
   100 
   102 
   101 testRemoveAllDeclareAll
   103 test05_RemoveAllDeclareAll
   102     "self debug: #testRemoveAllDeclareAll"
   104     "self debug: #testRemoveAllDeclareAll"
   103 
   105 
   104     "/ verifies that we can restore a dictionaries original contents
   106     "/ verifies that we can restore a dictionaries original contents
   105     "/ by making a copy of it, then redeclaring from the copy.
   107     "/ by making a copy of it, then redeclaring from the copy.
   106     "/ (needed by the refactorybrowser)
   108     "/ (needed by the refactorybrowser)