-
Notifications
You must be signed in to change notification settings - Fork 26
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
19 changed files
with
332 additions
and
4 deletions.
There are no files selected for viewing
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,3 @@ | ||
I'm a monticello writer for tonel format, writing the v3.0 of the format. | ||
|
||
v3.0 in the Pharo version exports the packages and tags as different properties. In legacy mode the categories are still exported but this can be disabled. |
2 changes: 1 addition & 1 deletion
2
MonticelloTonel-Core.package/TonelWriterV3.class/properties.json
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
4 changes: 4 additions & 0 deletions
4
MonticelloTonel-Tests.package/TonelWriterV3Test.class/instance/actualClass.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,4 @@ | ||
private - accessing | ||
actualClass | ||
|
||
^ TonelWriterV3 |
9 changes: 9 additions & 0 deletions
9
...-Tests.package/TonelWriterV3Test.class/instance/expectedBinaryInstanceMethodSourceCode.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,9 @@ | ||
private | ||
expectedBinaryInstanceMethodSourceCode | ||
|
||
^ ' | ||
{ #category : ''accessing'' } | ||
Object >> + a [. | ||
^ 42 | ||
] | ||
' |
12 changes: 12 additions & 0 deletions
12
...Test.class/instance/expectedClassDefinitionWithTraitCompositionFromRealClassSourceCode.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,12 @@ | ||
private | ||
expectedClassDefinitionWithTraitCompositionFromRealClassSourceCode | ||
|
||
^ 'Class { | ||
#name : ''SomeObject'', | ||
#superclass : ''Object'', | ||
#traits : ''T1 + T2'', | ||
#classTraits : ''T1 classTrait + T2 classTrait'', | ||
#category : ''MonticelloTonel-Tests'', | ||
#package : ''MonticelloTonel-Tests'' | ||
} | ||
' |
15 changes: 15 additions & 0 deletions
15
...TonelWriterV3Test.class/instance/expectedClassDefinitionWithTraitCompositionSourceCode.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,15 @@ | ||
private | ||
expectedClassDefinitionWithTraitCompositionSourceCode | ||
|
||
^ '" | ||
comment test | ||
" | ||
Class { | ||
#name : ''SomeObject'', | ||
#superclass : ''Object'', | ||
#traits : ''T1 + T2'', | ||
#classTraits : ''T1 classTrait + T2 classTrait'', | ||
#category : ''Kernel'', | ||
#package : ''Kernel'' | ||
} | ||
' |
12 changes: 12 additions & 0 deletions
12
...s.package/TonelWriterV3Test.class/instance/expectedClassWithTraitsDefinitionSourceCode.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,12 @@ | ||
private | ||
expectedClassWithTraitsDefinitionSourceCode | ||
|
||
^ 'Class { | ||
#name : ''SomeObject2'', | ||
#superclass : ''Object'', | ||
#traits : ''T1 + T2'', | ||
#classTraits : ''(T1 classTrait + T2 classTrait) - {#m1}'', | ||
#category : ''MonticelloTonel-Tests'', | ||
#package : ''MonticelloTonel-Tests'' | ||
} | ||
' |
9 changes: 9 additions & 0 deletions
9
...onel-Tests.package/TonelWriterV3Test.class/instance/expectedComparisonMethodSourceCode.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,9 @@ | ||
private | ||
expectedComparisonMethodSourceCode | ||
|
||
^ ' | ||
{ #category : ''comparing'' } | ||
Object >> = anObject [ | ||
^ self == anObject | ||
] | ||
' |
9 changes: 9 additions & 0 deletions
9
...Tests.package/TonelWriterV3Test.class/instance/expectedKeywordInstanceMethodSourceCode.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,9 @@ | ||
private | ||
expectedKeywordInstanceMethodSourceCode | ||
|
||
^ ' | ||
{ #category : ''accessing'' } | ||
Object >> min: a max: b [. | ||
^ 42 | ||
] | ||
' |
39 changes: 39 additions & 0 deletions
39
...lloTonel-Tests.package/TonelWriterV3Test.class/instance/expectedMTMockASubclassClassSt.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,39 @@ | ||
private | ||
expectedMTMockASubclassClassSt | ||
^ '" | ||
A mock class to verify serialization using Tonel format (as a subclass of MTMockClassA) with an instance and a class variable | ||
" | ||
Class { | ||
#name : ''MTMockSubclassOfA'', | ||
#superclass : ''MTMockClassA'', | ||
#instVars : [ | ||
''x'' | ||
], | ||
#classVars : [ | ||
''Y'' | ||
], | ||
#category : ''MonticelloTonel-Tests-Mocks-Base'', | ||
#package : ''MonticelloTonel-Tests-Mocks'', | ||
#tag : ''Base'' | ||
} | ||
{ #category : ''class initialization'' } | ||
MTMockSubclassOfA class >> initialize [ | ||
InitializationOrder := InitializationOrder | ||
ifNil: [ "let the test fail" -100 ] | ||
ifNotNil: [ InitializationOrder + 1 ] | ||
] | ||
{ #category : ''accessing'' } | ||
MTMockSubclassOfA >> variables [ | ||
^ x + Y + MTMockClassA | ||
] | ||
{ #category : ''accessing'' } | ||
MTMockSubclassOfA >> variables2 [ | ||
^ ivar + CVar | ||
] | ||
' |
110 changes: 110 additions & 0 deletions
110
...icelloTonel-Tests.package/TonelWriterV3Test.class/instance/expectedMTMockClassAClassSt.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,110 @@ | ||
private | ||
expectedMTMockClassAClassSt | ||
^ '" | ||
A mock class to verify serialization using Tonel format | ||
" | ||
Class { | ||
#name : ''MTMockClassA'', | ||
#superclass : ''MTMock'', | ||
#instVars : [ | ||
''ivar'' | ||
], | ||
#classVars : [ | ||
''CVar'', | ||
''InitializationOrder'' | ||
], | ||
#category : ''MonticelloTonel-Tests-Mocks-Base'', | ||
#package : ''MonticelloTonel-Tests-Mocks'', | ||
#tag : ''Base'' | ||
} | ||
{ #category : ''accessing'' } | ||
MTMockClassA class >> cVar [ | ||
^ CVar | ||
] | ||
{ #category : ''accessing'' } | ||
MTMockClassA class >> initializationOrder [ | ||
^ InitializationOrder | ||
] | ||
{ #category : ''class initialization'' } | ||
MTMockClassA class >> initialize [ | ||
CVar := #initialized. | ||
InitializationOrder := 1 | ||
] | ||
{ #category : ''accessing'' } | ||
MTMockClassA class >> one [ | ||
^ 1 | ||
] | ||
{ #category : ''operating'' } | ||
MTMockClassA class >> touchCVar [ | ||
CVar := #touched | ||
] | ||
{ #category : ''numeric'' } | ||
MTMockClassA >> a [ | ||
^ ''a2'' | ||
] | ||
{ #category : ''numeric'' } | ||
MTMockClassA >> b [ | ||
^ ''b1'' | ||
] | ||
{ #category : ''numeric'' } | ||
MTMockClassA >> c [ | ||
^ ''c1'' | ||
] | ||
{ #category : ''numeric'' } | ||
MTMockClassA >> d [ | ||
^ ''d'' | ||
] | ||
{ #category : ''boolean'' } | ||
MTMockClassA >> falsehood [ | ||
^ false | ||
] | ||
{ #category : ''don\''nt remove'' } | ||
MTMockClassA >> methodInCategoryWithApostrophe [ | ||
"A method that is grouped in a method category with an apostrophe" | ||
] | ||
{ #category : ''boolean'' } | ||
MTMockClassA >> moreTruth [ | ||
^ true | ||
] | ||
{ #category : ''numeric'' } | ||
MTMockClassA >> one [ | ||
^ 1 | ||
] | ||
{ #category : ''boolean'' } | ||
MTMockClassA >> truth [ | ||
^ true | ||
] | ||
{ #category : ''numeric'' } | ||
MTMockClassA >> two [ | ||
^ 2 | ||
] | ||
' |
13 changes: 13 additions & 0 deletions
13
...s.package/TonelWriterV3Test.class/instance/expectedSomeObjectClassDefinitionSourceCode.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,13 @@ | ||
private | ||
expectedSomeObjectClassDefinitionSourceCode | ||
|
||
^ '" | ||
comment test | ||
" | ||
Class { | ||
#name : ''SomeObject'', | ||
#superclass : ''Object'', | ||
#category : ''Kernel'', | ||
#package : ''Kernel'' | ||
} | ||
' |
28 changes: 28 additions & 0 deletions
28
...elWriterV3Test.class/instance/expectedSomeObjectClassDefinitionWithVariablesSourceCode.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,28 @@ | ||
private | ||
expectedSomeObjectClassDefinitionWithVariablesSourceCode | ||
|
||
^ '" | ||
comment test | ||
" | ||
Class { | ||
#name : ''SomeObject'', | ||
#superclass : ''Object'', | ||
#instVars : [ | ||
''a'', | ||
''b'', | ||
''c'' | ||
], | ||
#classVars : [ | ||
''D'', | ||
''E'' | ||
], | ||
#pools : [ | ||
''POOL'' | ||
], | ||
#classInstVars : [ | ||
''instVarA'' | ||
], | ||
#category : ''Kernel'', | ||
#package : ''Kernel'' | ||
} | ||
' |
29 changes: 29 additions & 0 deletions
29
...lloTonel-Tests.package/TonelWriterV3Test.class/instance/expectedSourceCodeForTonelMock.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,29 @@ | ||
private | ||
expectedSourceCodeForTonelMock | ||
|
||
^ '" | ||
Description | ||
-------------------- | ||
I am a simple Mock for Tonel export test | ||
" | ||
Class { | ||
#name : ''TonelMock'', | ||
#superclass : ''Object'', | ||
#category : ''MonticelloTonel-Tests-Mocking'', | ||
#package : ''MonticelloTonel-Tests'', | ||
#tag : ''Mocking'' | ||
} | ||
{ #category : ''accessing'' } | ||
TonelMock class >> classMethod [ | ||
^ 8 | ||
] | ||
{ #category : ''accessing'' } | ||
TonelMock >> instanceMethod [ | ||
^ true | ||
] | ||
' |
9 changes: 9 additions & 0 deletions
9
...lloTonel-Tests.package/TonelWriterV3Test.class/instance/expectedTonelWriterExtensionSt.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,9 @@ | ||
private | ||
expectedTonelWriterExtensionSt | ||
^ 'Extension { #name : ''TonelWriter'' } | ||
{ #category : ''*MonticelloTonel-Tests-Mocks'' } | ||
TonelWriter >> mockClassExtension [ | ||
"A mocked class extension used in tests - this method has to stay as an instance side extension on class TonelWriter and the extension method has to be packaged in MonticelloTonel-Tests-Mocks" | ||
] | ||
' |
9 changes: 9 additions & 0 deletions
9
...onel-Tests.package/TonelWriterV3Test.class/instance/expectedUnaryClassMethodSourceCode.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,9 @@ | ||
private | ||
expectedUnaryClassMethodSourceCode | ||
|
||
^ ' | ||
{ #category : ''accessing'' } | ||
Object class >> selector [ | ||
^ 42 | ||
] | ||
' |
9 changes: 9 additions & 0 deletions
9
...l-Tests.package/TonelWriterV3Test.class/instance/expectedUnaryInstanceMethodSourceCode.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,9 @@ | ||
private | ||
expectedUnaryInstanceMethodSourceCode | ||
|
||
^ ' | ||
{ #category : ''accessing'' } | ||
Object >> selector [ | ||
^ 42 | ||
] | ||
' |
9 changes: 9 additions & 0 deletions
9
...lWriterV3Test.class/instance/expectedUnaryInstanceMethodWithDotAfterSelectorSourceCode.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,9 @@ | ||
private | ||
expectedUnaryInstanceMethodWithDotAfterSelectorSourceCode | ||
|
||
^ ' | ||
{ #category : ''accessing'' } | ||
Object >> selector [. | ||
^ 42 | ||
] | ||
' |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
SystemOrganization addCategory: #'MonticelloTonel-Tests'! | ||
SystemOrganization addCategory: #'MonticelloTonel-Tests-Base'! | ||
SystemOrganization addCategory: #'MonticelloTonel-Tests-Mocking'! | ||
SystemOrganization addCategory: #'MonticelloTonel-Tests-Resources'! | ||
SystemOrganization addCategory: #'MonticelloTonel-Tests-Mocking-MonticelloTonel-Tests'! | ||
SystemOrganization addCategory: #'MonticelloTonel-Tests-Mocking-MonticelloTonel-Tests-Base'! | ||
SystemOrganization addCategory: #'MonticelloTonel-Tests-Mocking-MonticelloTonel-Tests-Resources'! |