forked from pharo-project/pharo
/
CDSlotParserSimpleInstanceVariableTest.class.st
49 lines (42 loc) · 1.24 KB
/
CDSlotParserSimpleInstanceVariableTest.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"
A slot definition can be composed as follows:
{
#x .
#x => Observable .
#x => (Observable keyword: literal message: literal2)
}
This tests is about the first case.
"
Class {
#name : #CDSlotParserSimpleInstanceVariableTest,
#superclass : #CDClassDefinitionParserTest,
#category : #'ClassParser-Tests'
}
{ #category : #helpers }
CDSlotParserSimpleInstanceVariableTest >> classDefinitionString [
^ '{superclassname} subclass: #{classname}
slots: \{
''{instvar1}'' .
''{instvar2}''
\}
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 : #tests }
CDSlotParserSimpleInstanceVariableTest >> testClassDefFromLegacyString [
" slot: { #instVar3} "
self assert: classDefinition slotNodes first name equals: 'first'.
self
assert: classDefinition slotNodes first slotClassName
equals: #InstanceVariableSlot.
self
assert: classDefinition slotNodes first initializationMessage printString
equals: ''.
]