Skip to content

Commit

Permalink
Merge pull request #121 from jecisc/categories
Browse files Browse the repository at this point in the history
Remove usage of categories
  • Loading branch information
MarcusDenker authored Oct 31, 2023
2 parents d355ad2 + 4b004f2 commit 91b776d
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ methodDefinitionOf: aMethodDefinition

| definition |
definition := OrderedDictionary new.
self at: #category put: aMethodDefinition category in: definition.
self at: #category put: aMethodDefinition protocol in: definition.
^ self toSTON: definition
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
private
packageNameForMethodDefinition: aMethodDefinition

| category |
self assert: aMethodDefinition category first = $*.
category := aMethodDefinition category allButFirst.
^ (MCWorkingCopy allWorkingCopies detect: [ :wc | category sameAs: wc packageName ]) packageName
| protocol |
self assert: aMethodDefinition protocol first = $*.
protocol := aMethodDefinition protocol allButFirst.
^ (MCWorkingCopy allWorkingCopies detect: [ :wc | protocol sameAs: wc packageName ]) packageName
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
tests
assertClassDefinition: a and: b
self assert: a className equals: b className.
self assert: a superclassName equals: b superclassName.
self assert: a traitCompositionString equals: b traitCompositionString.
self assert: a classTraitCompositionString equals: b classTraitCompositionString.
self assert: a category equals: b category.
self assert: a instVarNames equals: b instVarNames.
self assert: a classInstVarNames equals: b classInstVarNames.
self assert: a classVarNames equals: b classVarNames.
self assert: a poolDictionaries equals: b poolDictionaries.
self assert: a type equals: b type.
self assert: a comment equals: b comment
assertClassDefinition: actualDefinition and: expectedDefinition
self assert: actualDefinition className equals: expectedDefinition className.
self assert: actualDefinition superclassName equals: expectedDefinition superclassName.
self assert: actualDefinition traitCompositionString equals: expectedDefinition traitCompositionString.
self assert: actualDefinition classTraitCompositionString equals: expectedDefinition classTraitCompositionString.
self assert: actualDefinition packageName equals: expectedDefinition packageName.
self assert: actualDefinition tagName equals: expectedDefinition tagName.
self assert: actualDefinition instVarNames equals: expectedDefinition instVarNames.
self assert: actualDefinition classInstVarNames equals: expectedDefinition classInstVarNames.
self assert: actualDefinition classVarNames equals: expectedDefinition classVarNames.
self assert: actualDefinition poolDictionaries equals: expectedDefinition poolDictionaries.
self assert: actualDefinition type equals: expectedDefinition type.
self assert: actualDefinition comment equals: expectedDefinition comment
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
tests
assertDefinition: a and: b
a isOrganizationDefinition ifTrue: [ ^ self assertOrganisationDefinition: a and: b ].
a isClassDefinition ifTrue: [ ^ self assertClassDefinition: a and: b ].
a isMethodDefinition ifTrue: [ ^ self assertMethodDefinition: a and: b ]
assertDefinition: actualDefinition and: expectedDefinition

actualDefinition isOrganizationDefinition ifTrue: [ ^ self assertOrganisationDefinition: actualDefinition and: expectedDefinition ].
actualDefinition isClassDefinition ifTrue: [ ^ self assertClassDefinition: actualDefinition and: expectedDefinition ].
actualDefinition isMethodDefinition ifTrue: [ ^ self assertMethodDefinition: actualDefinition and: expectedDefinition ]
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
tests
assertMethodDefinition: a and: b
self assert: a className equals: b className.
self assert: a selector equals: b selector.
self assert: a protocol equals: b protocol.
self assert: a source asByteArray equals: b source asByteArray.
self assert: a classIsMeta equals: b classIsMeta
assertMethodDefinition: actualDefinition and: expectedDefinition

self assert: actualDefinition className equals: expectedDefinition className.
self assert: actualDefinition selector equals: expectedDefinition selector.
self assert: actualDefinition protocol equals: expectedDefinition protocol.
self assert: actualDefinition source asByteArray equals: expectedDefinition source asByteArray.
self assert: actualDefinition classIsMeta equals: expectedDefinition classIsMeta
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
tests
assertOrganisationDefinition: a and: b
self assert: a categories equals: b categories
assertOrganisationDefinition: actualDefinition and: expectedDefinition

self assert: actualDefinition packageName equals: expectedDefinition packageName.
self assert: actualDefinition tagNames equals: expectedDefinition tagNames
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ testHiddenFilesAreIgnored

reader definitions sorted
with: snapshot definitions sorted
do: [ :a :b | self assertDefinition: a and: b ] ]
do: [ :actualDefinition :expectedDefinition | self assertDefinition: actualDefinition and: expectedDefinition ] ]
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ testLoadDefinitions

reader definitions sorted
with: snapshot definitions sorted
do: [ :a :b | self assertDefinition: a and: b ] ]
do: [ :actualDefinition :expectedDefinition | self assertDefinition: actualDefinition and: expectedDefinition ] ]
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ testLoadSelectorWithComments

reader definitions sorted
with: snapshot definitions sorted
do: [ :a :b | self assertDefinition: a and: b ] ]
do: [ :actualDefinition :expectedDefinition | self assertDefinition: actualDefinition and: expectedDefinition ] ]

0 comments on commit 91b776d

Please sign in to comment.