Skip to content

Commit

Permalink
Merge pull request #164 from SeasideSt/slime-pharo12-fixes
Browse files Browse the repository at this point in the history
Slime pharo12 fixes
  • Loading branch information
jbrichau authored Dec 27, 2023
2 parents 4c70a7c + a11d35e commit b0307c4
Show file tree
Hide file tree
Showing 40 changed files with 120 additions and 179 deletions.
5 changes: 3 additions & 2 deletions repository/BaselineOfGrease.package/.filetree
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"noMethodMetaData" : true,
"separateMethodMetaAndSource" : false,
"useCypressPropertiesFile" : true }
"noMethodMetaData" : true,
"useCypressPropertiesFile" : true
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@ baselineSqueak: spec
package: 'Grease-Tests-Squeak-Core'
with: [ spec requires: #('Grease-Tests-Core') ];
package: 'Grease-Tests-Squeak5-Core'
with: [ spec requires: #('Grease-Tests-Squeak-Core') ];
package: 'Grease-Slime'
with: [ spec requires: #('Refactoring-Core' 'Grease-Core') ];
package: 'Grease-Tests-Slime'
with: [ spec requires: #('Grease-Slime') ].
spec
group: 'Slime' with: #('Grease-Slime');
group: 'Slime Tests' with: #('Grease-Tests-Slime') ].
with: [ spec requires: #('Grease-Tests-Squeak-Core') ] ].
spec
for: #(#'squeak6.x')
do: [
Expand All @@ -52,11 +45,4 @@ baselineSqueak: spec
package: 'Grease-Tests-Squeak-Core'
with: [ spec requires: #('Grease-Tests-Core') ];
package: 'Grease-Tests-Squeak6-Core'
with: [ spec requires: #('Grease-Tests-Squeak-Core') ];
package: 'Grease-Slime'
with: [ spec requires: #('Refactoring-Core' 'Grease-Core') ];
package: 'Grease-Tests-Slime'
with: [ spec requires: #('Grease-Slime') ].
spec
group: 'Slime' with: #('Grease-Slime');
group: 'Slime Tests' with: #('Grease-Tests-Slime') ]
with: [ spec requires: #('Grease-Tests-Squeak-Core') ] ]
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"category" : "BaselineOfGrease",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "BaselineOfGrease",
"pools" : [
],
"super" : "BaselineOf",
"type" : "normal" }
"category" : "BaselineOfGrease",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "BaselineOfGrease",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
SystemOrganization addCategory: #BaselineOfGrease!
SystemOrganization addCategory: #'BaselineOfGrease-Manifest'!
self packageOrganizer ensurePackage: #BaselineOfGrease withTags: #('Manifest')!
3 changes: 1 addition & 2 deletions repository/BaselineOfGrease.package/properties.json
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
{
}
{ }
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
accessing-code
compile: aString in: aClass
^ aClass compile: aString classified: #(accessing)

GRPlatform current
compile: aString
into: aClass
classified: #accessing
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
accessing-code
defineClass: aClassSymbol superclass: aSuperSymbol
| class |
model defineClass: aSuperSymbol , ' subclass: #' , aClassSymbol , '
instanceVariableNames: ''''
classVariableNames: ''''
poolDictionaries: ''''
category: ''' , self category , ''''.
class := model classNamed: aClassSymbol.
environment
addClass: class;
addClass: class theMetaClass.
^ class
"For compatibility"
^ self defineSubClassOf: aSuperSymbol
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
running
setUp
super setUp.
factory := ClassFactoryForTestCase new.
model := RBNamespace new.
environment := RBClassEnvironment new
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
running
tearDown

super tearDown.
(Smalltalk organization listAtCategoryNamed: self category) do:[ :e |
SmalltalkImage current removeClassNamed: e ].
Smalltalk organization
removeCategory: self category
factory cleanUp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
tests-parsetree
testBlockFormatting
| class |
class := self
defineClass: #GRSlimeMockObject
superclass: #GRObject.
class
class := self defineSubClassOf: #GRObject.
self
compile: 'invalid1
[:a ]'
classified: #(accessing).
class
in: class.
self
compile: 'invalid2
[:a | ]'
classified: #(accessing).
class
in: class.
self
compile: 'invalid3
[ :b]'
classified: #(accessing).
in: class.

class
self
compile: 'invalid4
[ :a| ]'
classified: #(accessing).
class
in: class.
self
compile: 'invalid5
[ :a |a ]'
classified: #(accessing).
in: class.
self
runRule: GRBlockFormattingRule
selectors: #(invalid1 invalid2 invalid3 invalid4 invalid5)
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
tests-block
testDeprecatedApiProtocol
| class |
class := self
defineClass: #GRSlimeMockObject
superclass: #GRObject.
self compile: 'deprecated1 self greaseDeprecatedApi: ''GRSlimeMockObject>>#deprecated1'' details: ''Something.''' in: class.
self compile: 'deprecated2 self greaseDeprecatedApi: ''GRSlimeMockObject>>#deprecated'' details: ''Something.''' in: class.
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.
self
runRule: GRDeprecatedApiProtocolRule
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
tests-parsetree
testParensFormatting
| class |
class := self
defineClass: #GRSlimeMockObject
superclass: #GRObject.
class
class := self defineSubClassOf: #GRObject.
self
compile: 'invalid1
( 1 + 2)'
classified: #(accessing).
class
in: class.
self
compile: 'invalid2
(1 + 2 )'
classified: #(accessing).
in: class.
self
runRule: GRParensFormattingRule
selectors: #(invalid1 invalid2)
Loading

0 comments on commit b0307c4

Please sign in to comment.