Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
97 additions
and
6 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
src/ClassParser-Tests/CDMoreComplexSlotParserTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Class { | ||
#name : #CDMoreComplexSlotParserTest, | ||
#superclass : #CDClassDefinitionParserTest, | ||
#category : #'ClassParser-Tests' | ||
} | ||
|
||
{ #category : #helpers } | ||
CDMoreComplexSlotParserTest >> classDefinitionString [ | ||
|
||
^ '{superclassname} subclass: #{classname} | ||
slots: \{ | ||
''{instvar1}'' => LazyClassVariable default: 5. | ||
''{instvar2}'' => InstanceVariableSlot. | ||
''instVar3'' | ||
\} | ||
classVariableNames: ''{classvar1} {classvar2}'' | ||
package: #MyPackage' | ||
format: { | ||
'classname' -> self className. | ||
'superclassname' -> self superclassName. | ||
'instvar1' -> self firstInstanceVariableName. | ||
'instvar2' -> self secondInstanceVariableName. | ||
'classvar1' -> self firstClassVariableName. | ||
'classvar2' -> self secondClassVariableName. } asDictionary | ||
] | ||
|
||
{ #category : #helpers } | ||
CDMoreComplexSlotParserTest >> testClassDefFromLegacyStringHasSlots [ | ||
|
||
self assert: classDefinition slotNodes first name equals: self firstInstanceVariableName. | ||
self assert: classDefinition slotNodes first typeName equals: #LazyClassVariable. | ||
self assert: classDefinition slotNodes first initializationMessage equals: 'default: 5'. | ||
|
||
self assert: classDefinition slotNodes second name equals: self secondInstanceVariableName. | ||
self assert: classDefinition slotNodes second typeName equals: #InstanceVariableSlot. | ||
|
||
self assert: classDefinition slotNodes third name equals: 'instVar3' | ||
|
||
|
||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters