-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from guillep/harvest-p9
Harvest changes done in Pharo9
- Loading branch information
Showing
55 changed files
with
149 additions
and
101 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
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
3 changes: 3 additions & 0 deletions
3
repository/STON-Core.package/FileReference.extension/instance/stonContainSubObjects.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,3 @@ | ||
*ston-core | ||
stonContainSubObjects | ||
^ false |
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
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
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
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
3 changes: 3 additions & 0 deletions
3
repository/STON-Core.package/ZnMimeType.extension/instance/stonContainSubObjects.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,3 @@ | ||
*ston-core | ||
stonContainSubObjects | ||
^ false |
3 changes: 3 additions & 0 deletions
3
repository/STON-Core.package/ZnUrl.extension/instance/stonContainSubObjects.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,3 @@ | ||
*ston-core | ||
stonContainSubObjects | ||
^ false |
21 changes: 9 additions & 12 deletions
21
repository/STON-Tests.package/STONJSONTest.class/instance/testOrderedDictionary.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 |
---|---|---|
@@ -1,26 +1,23 @@ | ||
tests | ||
testOrderedDictionary | ||
| odictClass odict json dict | | ||
|
||
odictClass := self environment at: #OrderedDictionary ifAbsent: [ ^ self skip ]. | ||
|
||
odict := odictClass newFrom: { | ||
'a' -> 42 . 'b' -> 1. 'aa' -> 4. 'c' -> 23 | ||
}. | ||
|
||
"assert that the order is not equal in the dictionary hash table". | ||
self | ||
|
||
odict := odictClass newFrom: {('a' -> 42) . ('b' -> 1) . ('aa' -> 4) . ('c' -> 23)}. | ||
|
||
"assert that the order is not equal in the dictionary hash table" | ||
self | ||
assertCollection: odict asArray hasSameElements: odict dictionary asArray; | ||
deny: odict asArray equals: odict dictionary asArray. | ||
|
||
"ordered presevered when encoding:" | ||
json := STONJSON toString: odict. | ||
self assert: json equals: '{"a":42,"b":1,"aa":4,"c":23}'. | ||
|
||
"lost when decoding" | ||
dict := STONJSON fromString: json. | ||
|
||
self | ||
self | ||
assertCollection: dict asArray hasSameElements: odict asArray; | ||
assert: dict equals: odict dictionary; | ||
deny: dict asArray equals: odict asArray | ||
deny: dict asArray equals: odict asArray |
6 changes: 6 additions & 0 deletions
6
repository/STON-Tests.package/STONLargeWriteReadTest.class/instance/materialize..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,6 @@ | ||
private | ||
materialize: string | ||
^ STON reader | ||
on: string readStream; | ||
optimizeForLargeStructures; | ||
next |
22 changes: 11 additions & 11 deletions
22
repository/STON-Tests.package/STONReaderTest.class/instance/testAssociation.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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
tests | ||
testAssociation | ||
self assert: (self materialize: '''foo'':1') equals: ('foo' -> 1). | ||
self assert: (self materialize: '#bar:2') equals: (#bar -> 2). | ||
self assert: (self materialize: '''foo bar'':#ok') equals: ('foo bar' -> #ok). | ||
self assert: (self materialize: '123:456') equals: (123 -> 456). | ||
self assert: (self materialize: '''foo'' : 1') equals: ('foo' -> 1). | ||
self assert: (self materialize: '#bar : 2') equals: (#bar -> 2). | ||
self assert: (self materialize: '''foo bar'' : #ok') equals: ('foo bar' -> #ok). | ||
self assert: (self materialize: '123 : -456') equals: (123 -> -456). | ||
self assert: (self materialize: '#foo : 1 : 2') equals: (#foo -> (1 -> 2)) | ||
self assert: (self materialize: '''foo'':1') equals: 'foo' -> 1. | ||
self assert: (self materialize: '#bar:2') equals: #bar -> 2. | ||
self assert: (self materialize: '''foo bar'':#ok') equals: 'foo bar' -> #ok. | ||
self assert: (self materialize: '123:456') equals: 123 -> 456. | ||
|
||
self assert: (self materialize: '''foo'' : 1') equals: 'foo' -> 1. | ||
self assert: (self materialize: '#bar : 2') equals: #bar -> 2. | ||
self assert: (self materialize: '''foo bar'' : #ok') equals: 'foo bar' -> #ok. | ||
self assert: (self materialize: '123 : -456') equals: 123 -> -456. | ||
|
||
self assert: (self materialize: '#foo : 1 : 2') equals: #foo -> (1 -> 2) |
2 changes: 1 addition & 1 deletion
2
repository/STON-Tests.package/STONReaderTest.class/instance/testByteArray.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
tests | ||
testByteArray | ||
self assert: (self materialize: 'ByteArray[''010203'']') equals: #(1 2 3) asByteArray | ||
self assert: (self materialize: 'ByteArray[''010203'']') equals: #(1 2 3) asByteArray |
2 changes: 1 addition & 1 deletion
2
repository/STON-Tests.package/STONReaderTest.class/instance/testCharacter.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
tests | ||
testCharacter | ||
self assert: (self materialize: 'Character[''A'']') identicalTo: $A. | ||
self assert: (self materialize: 'Character[''A'']') identicalTo: $A |
9 changes: 8 additions & 1 deletion
9
repository/STON-Tests.package/STONReaderTest.class/instance/testDateAndTime.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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
tests | ||
testDateAndTime | ||
| dateAndTime | | ||
dateAndTime := DateAndTime year: 2012 month: 1 day: 1 hour: 6 minute: 30 second: 15 offset: 1 hour. | ||
dateAndTime := DateAndTime | ||
year: 2012 | ||
month: 1 | ||
day: 1 | ||
hour: 6 | ||
minute: 30 | ||
second: 15 | ||
offset: 1 hour. | ||
self assert: (self materialize: 'DateAndTime[''2012-01-01T06:30:15+01:00'']') equals: dateAndTime |
7 changes: 5 additions & 2 deletions
7
repository/STON-Tests.package/STONReaderTest.class/instance/testDictionary.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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
tests | ||
testDictionary | ||
| collection | | ||
collection := STON mapClass new at: 1 put: 1; at: 2 put: 2; yourself. | ||
collection := STON mapClass new | ||
at: 1 put: 1; | ||
at: 2 put: 2; | ||
yourself. | ||
self assert: (self materialize: '{1:1,2:2}') equals: collection. | ||
self assert: (self materialize: '{}') equals: STON mapClass new. | ||
self assert: (self materialize: '{}') equals: STON mapClass new |
5 changes: 4 additions & 1 deletion
5
repository/STON-Tests.package/STONReaderTest.class/instance/testDictionaryWithComplexKeys.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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
tests | ||
testDictionaryWithComplexKeys | ||
| collection reader | | ||
collection := STON mapClass new at: true put: 1; at: #(foo) put: 2; yourself. | ||
collection := STON mapClass new | ||
at: true put: 1; | ||
at: #(foo) put: 2; | ||
yourself. | ||
"allowing complex map keys used to be optional, now it is always the default" | ||
reader := STONReader on: '{true:1,[#foo]:2}' readStream. | ||
self assert: reader next equals: collection |
7 changes: 5 additions & 2 deletions
7
repository/STON-Tests.package/STONReaderTest.class/instance/testIdentityDictionary.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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
tests | ||
testIdentityDictionary | ||
| collection | | ||
collection := IdentityDictionary new at: 1 put: 1; at: 2 put: 2; yourself. | ||
collection := IdentityDictionary new | ||
at: 1 put: 1; | ||
at: 2 put: 2; | ||
yourself. | ||
self assert: (self materialize: 'IdentityDictionary{1:1,2:2}') equals: collection. | ||
self assert: (self materialize: 'IdentityDictionary{}') equals: IdentityDictionary new. | ||
self assert: (self materialize: 'IdentityDictionary{}') equals: IdentityDictionary new |
7 changes: 3 additions & 4 deletions
7
repository/STON-Tests.package/STONReaderTest.class/instance/testJsonString.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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
tests | ||
testJsonString | ||
"Allow double quotes for backwards JSON compatibility" | ||
|
||
| string | | ||
self assert: (self materialize: '"foo"') equals: 'foo'. | ||
self assert: (self materialize: '"FOO"') equals: 'FOO'. | ||
self assert: (self materialize: '"\u00E9l\u00E8ve en Fran\u00E7ais"') equals: 'élève en Français'. | ||
string := String withAll: { | ||
$". $'. $\. Character tab. Character cr. Character lf. Character newPage. Character backspace }. | ||
self assert: (self materialize: '"\"\''\\\t\r\n\f\b"') equals: string. | ||
string := String withAll: {$" . $' . $\ . Character tab . Character cr . Character lf . Character newPage . Character backspace}. | ||
self assert: (self materialize: '"\"\''\\\t\r\n\f\b"') equals: string |
7 changes: 6 additions & 1 deletion
7
repository/STON-Tests.package/STONReaderTest.class/instance/testMap.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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
tests | ||
testMap | ||
self assert: (self materialize: '{#foo:1}') equals: (STON mapClass new at: #foo put: 1; yourself). | ||
self | ||
assert: (self materialize: '{#foo:1}') | ||
equals: | ||
(STON mapClass new | ||
at: #foo put: 1; | ||
yourself). | ||
self assert: (self materialize: '{}') equals: STON mapClass new |
4 changes: 2 additions & 2 deletions
4
repository/STON-Tests.package/STONReaderTest.class/instance/testObject.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
tests | ||
testObject | ||
self assert: (self materialize: 'Point[1,2]') equals: (1@2). | ||
self assert: (self materialize: 'Point[1.5,-0.5]') equals: (1.5 @ -0.5). | ||
self assert: (self materialize: 'Point[1,2]') equals: 1 @ 2. | ||
self assert: (self materialize: 'Point[1.5,-0.5]') equals: 1.5 @ -0.5 |
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
2 changes: 1 addition & 1 deletion
2
repository/STON-Tests.package/STONReaderTest.class/instance/testPoint.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
tests | ||
testPoint | ||
self assert: (self materialize: 'Point[1,2]') equals: (1@2) | ||
self assert: (self materialize: 'Point[1,2]') equals: 1 @ 2 |
2 changes: 1 addition & 1 deletion
2
repository/STON-Tests.package/STONReaderTest.class/instance/testReferenceCycle.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
6 changes: 3 additions & 3 deletions
6
repository/STON-Tests.package/STONReaderTest.class/instance/testReferenceSharing.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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
tests | ||
testReferenceSharing | ||
| one array | | ||
one := { #one }. | ||
array := (self materialize: '[[#one],@2,@2]'). | ||
self assert: array = (STON listClass with: one with: one with: one). | ||
one := {#one}. | ||
array := self materialize: '[[#one],@2,@2]'. | ||
self assert: array equals: (STON listClass with: one with: one with: one). | ||
self assert: array first identicalTo: array second. | ||
self assert: array first identicalTo: array third |
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
5 changes: 2 additions & 3 deletions
5
repository/STON-Tests.package/STONReaderTest.class/instance/testWhitespace.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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
tests | ||
testWhitespace | ||
| whitespace | | ||
whitespace := { Character space. Character tab. Character cr. Character lf }. | ||
self assert: (self materialize: whitespace, '123') equals: 123 | ||
|
||
whitespace := {Character space . Character tab . Character cr . Character lf}. | ||
self assert: (self materialize: whitespace , '123') equals: 123 |
2 changes: 1 addition & 1 deletion
2
repository/STON-Tests.package/STONTest.class/instance/testFromString.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
tests | ||
testFromString | ||
| object | | ||
object := STON listClass withAll: { 1. 0. -1. true. false. nil }. | ||
object := STON listClass withAll: {1 . 0 . -1 . true . false . nil}. | ||
self assert: (STON fromString: '[1,0,-1,true,false,nil]') equals: object |
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
2 changes: 1 addition & 1 deletion
2
repository/STON-Tests.package/STONTest.class/instance/testToString.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
tests | ||
testToString | ||
| object | | ||
object := STON listClass withAll: { 1. 0. -1. true. false. nil }. | ||
object := STON listClass withAll: {1 . 0 . -1 . true . false . nil}. | ||
self assert: (STON toString: object) equals: '[1,0,-1,true,false,nil]' |
2 changes: 1 addition & 1 deletion
2
repository/STON-Tests.package/STONTestKnownObject.class/class/addKnownObject..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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
acccessing | ||
accessing | ||
addKnownObject: object | ||
^ self knownObjects addIfNotPresent: object |
2 changes: 1 addition & 1 deletion
2
repository/STON-Tests.package/STONTestKnownObject.class/class/fromId..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
2 changes: 1 addition & 1 deletion
2
repository/STON-Tests.package/STONTestKnownObject.class/class/knownObjects.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
acccessing | ||
accessing | ||
knownObjects | ||
^ KnownObjects ifNil: [ KnownObjects := OrderedCollection new ] |
2 changes: 1 addition & 1 deletion
2
repository/STON-Tests.package/STONTestKnownObject.class/class/resetKnownObjects.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
acccessing | ||
accessing | ||
resetKnownObjects | ||
KnownObjects ifNotNil: [ :collection | collection removeAll ] |
6 changes: 6 additions & 0 deletions
6
repository/STON-Tests.package/STONWriteReadCommentsTest.class/instance/materialize..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,6 @@ | ||
private | ||
materialize: string | ||
^ STON reader | ||
on: (STONCStyleCommentsSkipStream on: string readStream); | ||
optimizeForLargeStructures; | ||
next |
4 changes: 3 additions & 1 deletion
4
repository/STON-Tests.package/STONWriteReadTest.class/instance/materialize..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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
private | ||
materialize: string | ||
^ (self reader: string) next | ||
^ STON reader | ||
on: string readStream; | ||
next |
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
2 changes: 1 addition & 1 deletion
2
repository/STON-Tests.package/STONWriteReadTest.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
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
Oops, something went wrong.