Skip to content

Commit a11d35e

Browse files
author
Johan Brichau
committed
class creation in testcases cannot have a name
1 parent b156b53 commit a11d35e

30 files changed

+50
-102
lines changed
Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
11
accessing-code
22
defineClass: aClassSymbol superclass: aSuperSymbol
3-
4-
| class |
5-
class := SystemVersion current major >= 12
6-
ifTrue: [
7-
factory make: [ :aBuilder |
8-
aBuilder
9-
superclass: (Smalltalk at: aSuperSymbol);
10-
package: self category ] ]
11-
ifFalse: [
12-
factory
13-
newSubclassOf: (Smalltalk at: aSuperSymbol)
14-
instanceVariableNames: ''
15-
classVariableNames: 'classVarsString'
16-
category: self category ].
17-
environment
18-
addClass: class;
19-
addClass: class theMetaClass.
20-
^ class
3+
"For compatibility"
4+
^ self defineSubClassOf: aSuperSymbol
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
accessing-code
2+
defineSubClassOf: aSuperSymbol
3+
4+
| class |
5+
class := SystemVersion current major >= 12
6+
ifTrue: [
7+
factory make: [ :aBuilder |
8+
aBuilder
9+
superclass: (Smalltalk at: aSuperSymbol);
10+
package: self category ] ]
11+
ifFalse: [
12+
factory
13+
newSubclassOf: (Smalltalk at: aSuperSymbol)
14+
instanceVariableNames: ''
15+
classVariableNames: 'classVarsString'
16+
category: self category ].
17+
environment
18+
addClass: class;
19+
addClass: class theMetaClass.
20+
^ class

repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiBooleansRule.st

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
tests-transform
22
testAnsiBooleansRule
33
| class |
4-
class := self
5-
defineClass: #GRSlimeMockObject
6-
superclass: #GRObject.
4+
class := self defineSubClassOf: #GRObject.
75
self compile: 'and 1 and: [ 2 ] and: [ 3 ] and: [ 4 ]' in: class.
86
self compile: 'or 1 or: [ 2 ] or: [ 3 ] or: [ 4 ]' in: class.
97
self

repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiCharacterRule.st

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
tests-transform
22
testAnsiCharacterRule
33
| class |
4-
class := self
5-
defineClass: #GRSlimeMockObject
6-
superclass: #GRObject.
4+
class := self defineSubClassOf: #GRObject.
75
self compile: 'character Character value: 123' in: class.
86
self compile: 'characterRange $a to: $c' in: class.
97
self

repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiCollectionsRule.st

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
tests-transform
22
testAnsiCollectionsRule
33
| class |
4-
class := self
5-
defineClass: #GRSlimeMockObject
6-
superclass: #GRObject.
4+
class := self defineSubClassOf: #GRObject.
75
self compile: 'withIndexDo #() withIndexDo: [ :each :index | each + index ]' in: class.
86
self compile: 'doWithIndex #() doWithIndex: [ :each :index | each + index ]' in: class.
97
self compile: 'collectThenDo #() collect: [ :a | a ] thenDo: [ :b | b ]' in: class.

repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiConditionalsRule.st

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
tests-transform
22
testAnsiConditionalsRule
33
| class |
4-
class := self
5-
defineClass: #GRSlimeMockObject
6-
superclass: #GRObject.
4+
class := self defineSubClassOf: #GRObject.
75
self compile: 'ifNotNil 1 ifNotNil: [ | a | self or. self and ]' in: class.
86
self compile: 'ifNotNilDo 1 ifNotNilDo: [ :a | ^ a ]' in: class.
97
self

repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiConvertorRule.st

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
tests-transform
22
testAnsiConvertorRule
33
| class |
4-
class := self
5-
defineClass: #GRSlimeMockObject
6-
superclass: #GRObject.
4+
class := self defineSubClassOf: #GRObject.
75
self compile: 'convertInteger ''1'' asInteger' in: class.
86
self compile: 'convertString 2 asString' in: class.
97
self

repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiExceptionsRule.st

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
tests-transform
22
testAnsiExceptionsRule
33
| class |
4-
class := self
5-
defineClass: #GRSlimeMockObject
6-
superclass: #GRObject.
4+
class := self defineSubClassOf: #GRObject.
75
self compile: 'exception1 [ self or ] on: Error do: [ self or ]' in: class.
86
self compile: 'exception2 [ self or ] on: Error do: [ self or. self or ]' in: class.
97
self compile: 'exception3 [ self or ] on: Error do: [ | a | a := 0 ]' in: class.

repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiStreamsRule.st

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
tests-transform
22
testAnsiStreamsRule
33
| class |
4-
class := self
5-
defineClass: #GRSlimeMockObject
6-
superclass: #GRObject.
4+
class := self defineSubClassOf: #GRObject.
75
self compile: 'writeStream ^ '''' writeStream' in: class.
86
self compile: 'writeCr | stream | stream := WriteStream on: ''''. stream cr. stream nextPut: Character cr' in: class.
97
self compile: 'writeLf | stream | stream := WriteStream on: ''''. stream lf. stream nextPut: Character lf' in: class.

repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiStringsRule.st

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
tests-transform
22
testAnsiStringsRule
33
| class |
4-
class := self
5-
defineClass: #GRSlimeMockObject
6-
superclass: #GRObject.
4+
class := self defineSubClassOf: #GRObject.
75
self compile: 'stringCr String cr, (String with: Character cr)' in: class.
86
self compile: 'stringTab String tab, (String with: Character tab)' in: class.
97
self compile: 'stringLf String lf, (String with: Character lf)' in: class.

0 commit comments

Comments
 (0)