From a11d35e3611c11dcd59ea4363364cafa7bd0f36d Mon Sep 17 00:00:00 2001 From: Johan Brichau Date: Wed, 27 Dec 2023 22:39:32 +0100 Subject: [PATCH] class creation in testcases cannot have a name --- .../instance/defineClass.superclass..st | 20 ++----------------- .../instance/defineSubClassOf..st | 20 +++++++++++++++++++ .../instance/testAnsiBooleansRule.st | 4 +--- .../instance/testAnsiCharacterRule.st | 4 +--- .../instance/testAnsiCollectionsRule.st | 4 +--- .../instance/testAnsiConditionalsRule.st | 4 +--- .../instance/testAnsiConvertorRule.st | 4 +--- .../instance/testAnsiExceptionsRule.st | 4 +--- .../instance/testAnsiStreamsRule.st | 4 +--- .../instance/testAnsiStringsRule.st | 4 +--- .../instance/testBasicNewInitializeMissing.st | 4 +--- .../instance/testBlockFormatting.st | 4 +--- .../instance/testDeprecatedApiProtocol.st | 4 +--- .../instance/testEmptyStatements.st | 4 +--- .../testInvalidObjectInitialization.st | 4 +--- .../instance/testNonPortableMessageRule.st | 4 +--- .../instance/testNonPortableSourceFormat.st | 4 +--- .../testNotPortableCollectionsRule.st | 4 +--- .../instance/testObjectIn.st | 4 +--- .../instance/testParensFormatting.st | 4 +--- .../instance/testReturnFormatting.st | 4 +--- .../instance/testTempsFormatting.st | 4 +--- .../instance/testTestCaseFailRule.st | 4 +--- .../instance/testUnnecessaryLastPeriodRule.st | 4 +--- .../testUsesCanPerformOrUnderstand.st | 4 +--- .../instance/testUsesClassForHash.st | 4 +--- .../instance/testUsesCurlyBraceArrays.st | 4 +--- .../instance/testUsesLiteralByteArrays.st | 4 +--- .../instance/testUsesMethodAnnotations.st | 4 +--- .../instance/testUsesNotPortableClass.st | 4 +--- 30 files changed, 50 insertions(+), 102 deletions(-) create mode 100644 repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/defineSubClassOf..st diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/defineClass.superclass..st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/defineClass.superclass..st index d5ecb9a8..9769e83e 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/defineClass.superclass..st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/defineClass.superclass..st @@ -1,20 +1,4 @@ accessing-code defineClass: aClassSymbol superclass: aSuperSymbol - - | class | - class := SystemVersion current major >= 12 - ifTrue: [ - factory make: [ :aBuilder | - aBuilder - superclass: (Smalltalk at: aSuperSymbol); - package: self category ] ] - ifFalse: [ - factory - newSubclassOf: (Smalltalk at: aSuperSymbol) - instanceVariableNames: '' - classVariableNames: 'classVarsString' - category: self category ]. - environment - addClass: class; - addClass: class theMetaClass. - ^ class \ No newline at end of file + "For compatibility" + ^ self defineSubClassOf: aSuperSymbol \ No newline at end of file diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/defineSubClassOf..st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/defineSubClassOf..st new file mode 100644 index 00000000..4921f353 --- /dev/null +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/defineSubClassOf..st @@ -0,0 +1,20 @@ +accessing-code +defineSubClassOf: aSuperSymbol + + | class | + class := SystemVersion current major >= 12 + ifTrue: [ + factory make: [ :aBuilder | + aBuilder + superclass: (Smalltalk at: aSuperSymbol); + package: self category ] ] + ifFalse: [ + factory + newSubclassOf: (Smalltalk at: aSuperSymbol) + instanceVariableNames: '' + classVariableNames: 'classVarsString' + category: self category ]. + environment + addClass: class; + addClass: class theMetaClass. + ^ class \ No newline at end of file diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiBooleansRule.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiBooleansRule.st index 7f500fce..d4560588 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiBooleansRule.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiBooleansRule.st @@ -1,9 +1,7 @@ tests-transform testAnsiBooleansRule | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'and 1 and: [ 2 ] and: [ 3 ] and: [ 4 ]' in: class. self compile: 'or 1 or: [ 2 ] or: [ 3 ] or: [ 4 ]' in: class. self diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiCharacterRule.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiCharacterRule.st index 192f1f82..f8d58d84 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiCharacterRule.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiCharacterRule.st @@ -1,9 +1,7 @@ tests-transform testAnsiCharacterRule | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'character Character value: 123' in: class. self compile: 'characterRange $a to: $c' in: class. self diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiCollectionsRule.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiCollectionsRule.st index 21f66b65..8b101581 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiCollectionsRule.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiCollectionsRule.st @@ -1,9 +1,7 @@ tests-transform testAnsiCollectionsRule | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'withIndexDo #() withIndexDo: [ :each :index | each + index ]' in: class. self compile: 'doWithIndex #() doWithIndex: [ :each :index | each + index ]' in: class. self compile: 'collectThenDo #() collect: [ :a | a ] thenDo: [ :b | b ]' in: class. diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiConditionalsRule.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiConditionalsRule.st index 0819b8e6..e1ac638b 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiConditionalsRule.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiConditionalsRule.st @@ -1,9 +1,7 @@ tests-transform testAnsiConditionalsRule | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'ifNotNil 1 ifNotNil: [ | a | self or. self and ]' in: class. self compile: 'ifNotNilDo 1 ifNotNilDo: [ :a | ^ a ]' in: class. self diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiConvertorRule.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiConvertorRule.st index b51f8a3c..898f4f52 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiConvertorRule.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiConvertorRule.st @@ -1,9 +1,7 @@ tests-transform testAnsiConvertorRule | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'convertInteger ''1'' asInteger' in: class. self compile: 'convertString 2 asString' in: class. self diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiExceptionsRule.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiExceptionsRule.st index 61cd5cd8..7232e149 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiExceptionsRule.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiExceptionsRule.st @@ -1,9 +1,7 @@ tests-transform testAnsiExceptionsRule | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'exception1 [ self or ] on: Error do: [ self or ]' in: class. self compile: 'exception2 [ self or ] on: Error do: [ self or. self or ]' in: class. self compile: 'exception3 [ self or ] on: Error do: [ | a | a := 0 ]' in: class. diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiStreamsRule.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiStreamsRule.st index d57fbb32..5f1430b1 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiStreamsRule.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiStreamsRule.st @@ -1,9 +1,7 @@ tests-transform testAnsiStreamsRule | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'writeStream ^ '''' writeStream' in: class. self compile: 'writeCr | stream | stream := WriteStream on: ''''. stream cr. stream nextPut: Character cr' in: class. self compile: 'writeLf | stream | stream := WriteStream on: ''''. stream lf. stream nextPut: Character lf' in: class. diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiStringsRule.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiStringsRule.st index 73f65771..dde1cae1 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiStringsRule.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testAnsiStringsRule.st @@ -1,9 +1,7 @@ tests-transform testAnsiStringsRule | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'stringCr String cr, (String with: Character cr)' in: class. self compile: 'stringTab String tab, (String with: Character tab)' in: class. self compile: 'stringLf String lf, (String with: Character lf)' in: class. diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testBasicNewInitializeMissing.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testBasicNewInitializeMissing.st index 137714dd..07bf2a45 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testBasicNewInitializeMissing.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testBasicNewInitializeMissing.st @@ -1,9 +1,7 @@ tests-block testBasicNewInitializeMissing | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #Object. + class := self defineSubClassOf: #Object. self compile: 'initialize' in: class. self runRule: GRBasicNewInitializeMissingRule diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testBlockFormatting.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testBlockFormatting.st index d20133b3..21cb487d 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testBlockFormatting.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testBlockFormatting.st @@ -1,9 +1,7 @@ tests-parsetree testBlockFormatting | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'invalid1 [:a ]' diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testDeprecatedApiProtocol.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testDeprecatedApiProtocol.st index 71749169..5735b56e 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testDeprecatedApiProtocol.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testDeprecatedApiProtocol.st @@ -1,9 +1,7 @@ tests-block testDeprecatedApiProtocol | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'deprecated1 self greaseDeprecatedApi: ''',class name,'>>#deprecated1'' details: ''Something.''' in: class. self compile: 'deprecated2 self greaseDeprecatedApi: ''',class name,'>>#deprecated'' details: ''Something.''' in: class. self compile: 'deprecated3 self greaseDeprecatedApi: ''GRSlimeMock>>#deprecated3'' details: ''Something.''' in: class. diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testEmptyStatements.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testEmptyStatements.st index 2db3ea85..e4b03969 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testEmptyStatements.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testEmptyStatements.st @@ -1,9 +1,7 @@ tests-block testEmptyStatements | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'emptyStatement1. self and' in: class. self compile: 'emptyStatement2 self and..' in: class. self compile: 'emptyStatement3 self and."foo".' in: class. diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testInvalidObjectInitialization.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testInvalidObjectInitialization.st index a3ad223e..f11fb191 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testInvalidObjectInitialization.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testInvalidObjectInitialization.st @@ -1,9 +1,7 @@ tests-block testInvalidObjectInitialization | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'initializeFoo: aNumber' in: class. self runRule: GRInvalidObjectInitializationRule diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNonPortableMessageRule.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNonPortableMessageRule.st index 6deafde9..b9254341 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNonPortableMessageRule.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNonPortableMessageRule.st @@ -1,9 +1,7 @@ tests-block testNonPortableMessageRule | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'invalid1 ^ Array new anyOne' in: class. self compile: 'valid1 ^ Array new first' in: class. diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNonPortableSourceFormat.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNonPortableSourceFormat.st index 7fd6ab30..cad8fe0b 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNonPortableSourceFormat.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNonPortableSourceFormat.st @@ -1,9 +1,7 @@ tests-block testNonPortableSourceFormat | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'invalid ^ ''Unicode snow man', (String with: (Character codePoint: 16r2603)) , '''' in: class. self compile: 'valid ^ ''everything is fine''' in: class. self diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNotPortableCollectionsRule.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNotPortableCollectionsRule.st index a0977f60..039b45c2 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNotPortableCollectionsRule.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNotPortableCollectionsRule.st @@ -1,9 +1,7 @@ tests-transform testNotPortableCollectionsRule | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'beginsWith1 ''abc'' beginsWith: ''a''' in: class. self compile: 'endsWith1 ''abc'' endsWith: ''a''' in: class. self diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testObjectIn.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testObjectIn.st index 7773b660..5aec1103 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testObjectIn.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testObjectIn.st @@ -1,9 +1,7 @@ tests-transform testObjectIn | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'objectIn1 1 in: [ :val | val factorial ]' in: class. self compile: 'objectIn2 2 in: [ :val | | temps | val factorial ]' in: class. self compile: 'objectIn3 2 in: [ ''not this'' ]' in: class. diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testParensFormatting.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testParensFormatting.st index e3a5b541..a632b605 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testParensFormatting.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testParensFormatting.st @@ -1,9 +1,7 @@ tests-parsetree testParensFormatting | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'invalid1 ( 1 + 2)' diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testReturnFormatting.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testReturnFormatting.st index 3143391b..27d8438d 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testReturnFormatting.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testReturnFormatting.st @@ -1,9 +1,7 @@ tests-parsetree testReturnFormatting | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'invalid1 ^1' diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testTempsFormatting.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testTempsFormatting.st index ae200d7b..2eddb2b4 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testTempsFormatting.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testTempsFormatting.st @@ -1,9 +1,7 @@ tests-parsetree testTempsFormatting | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'invalid1 | a|' diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testTestCaseFailRule.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testTestCaseFailRule.st index 987fa755..a4800822 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testTestCaseFailRule.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testTestCaseFailRule.st @@ -1,9 +1,7 @@ tests-transform testTestCaseFailRule | class | - class := self - defineClass: #GRSlimeMockObjectTest - superclass: #TestCase. + class := self defineSubClassOf: #TestCase. self compile: 'testMethod self fail' in: class. self runTransformation: GRTestAssertionsRule diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUnnecessaryLastPeriodRule.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUnnecessaryLastPeriodRule.st index 71a76406..b96f1b62 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUnnecessaryLastPeriodRule.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUnnecessaryLastPeriodRule.st @@ -1,9 +1,7 @@ tests-block testUnnecessaryLastPeriodRule | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'invalid 1. 2.' in: class. self compile: 'valid 1. 2' in: class. self diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesCanPerformOrUnderstand.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesCanPerformOrUnderstand.st index 8c8e5273..a29a53fb 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesCanPerformOrUnderstand.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesCanPerformOrUnderstand.st @@ -1,9 +1,7 @@ tests-parsetree testUsesCanPerformOrUnderstand | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'invalid1 Object class canUnderstand: #new' diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesClassForHash.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesClassForHash.st index a20c01ad..e95c920c 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesClassForHash.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesClassForHash.st @@ -1,9 +1,7 @@ tests-parsetree testUsesClassForHash | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'foo ^ super hash bitXor: self class hash' diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesCurlyBraceArrays.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesCurlyBraceArrays.st index 38406441..7e341c1e 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesCurlyBraceArrays.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesCurlyBraceArrays.st @@ -3,9 +3,7 @@ testUsesCurlyBraceArrays | class | (self canParse: 'foo { self foo. self bar }') ifFalse: [ ^ self ]. - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'invalid ^ { self foo. self bar }' diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesLiteralByteArrays.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesLiteralByteArrays.st index bc042f82..342eb995 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesLiteralByteArrays.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesLiteralByteArrays.st @@ -3,9 +3,7 @@ testUsesLiteralByteArrays | class | (self canParse: 'foo #[ 1 2 3 ]') ifFalse: [ ^ self ]. - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'invalid ^ #[ 1 2 3 ]' diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesMethodAnnotations.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesMethodAnnotations.st index 39519d9b..dd1e7931 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesMethodAnnotations.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesMethodAnnotations.st @@ -3,9 +3,7 @@ testUsesMethodAnnotations | class | (self canParse: 'foo ') ifFalse: [ ^ self ]. - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'invalid ' in: class. self compile: 'valid' in: class. self diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesNotPortableClass.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesNotPortableClass.st index a4945bb4..d988a2fd 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesNotPortableClass.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testUsesNotPortableClass.st @@ -1,9 +1,7 @@ tests-block testUsesNotPortableClass | class | - class := self - defineClass: #GRSlimeMockObject - superclass: #GRObject. + class := self defineSubClassOf: #GRObject. self compile: 'invalid ^ Semaphore new' in: class. self compile: 'valid ^ GRObject new' in: class. self