Skip to content

Commit 62f18a7

Browse files
committed
- Changed MpSettings>>formatVersion's default to 2013.
- Updated old format tests to use non-default settings.
1 parent be56cc8 commit 62f18a7

File tree

11 files changed

+34
-25
lines changed

11 files changed

+34
-25
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
accessing
22
formatVersion
33
"2008, 2013"
4-
^self at: #formatVersion ifAbsent: [2008]
4+
^self at: #formatVersion ifAbsent: [2013]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
accessing
2+
legacyFormat
3+
^self formatVersion: 2008

repository/MessagePack-Core.package/MpSettings.class/methodProperties.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
"encodeMode:" : "MasashiUmezawa 2/2/2013 00:30",
1717
"fastBulkWrite" : "mu 10/29/2011 23:24",
1818
"fastBulkWrite:" : "mu 10/29/2011 22:52",
19-
"formatVersion" : "mu 8/19/2013 00:57",
19+
"formatVersion" : "MasashiUmezawa 6/21/2015 16:12",
2020
"formatVersion:" : "mu 8/19/2013 00:37",
2121
"includesKey:" : "mu 4/29/2011 15:12",
2222
"initialize" : "mu 4/29/2011 15:12",
2323
"keys" : "mu 4/29/2011 15:12",
24+
"legacyFormat" : "MasashiUmezawa 6/21/2015 16:20",
2425
"printOn:" : "MasashiUmezawa 2/2/2013 00:18",
2526
"settingsDict" : "mu 4/29/2011 15:12",
2627
"stringAsBytes" : "mu 5/2/2012 12:04",

repository/MessagePack-Core.package/monticello.meta/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(name 'MessagePack-Core-MasashiUmezawa.33' message 'Fixed a mapping bug in MpDecodeTypeMapper>>bytesAsString' id 'd6135ce8-d710-444d-b3b0-2a6c24168765' date '23 May 2015' time '11:36:39.85456 pm' author 'MasashiUmezawa' ancestors ((name 'MessagePack-Core-MasashiUmezawa.32' message 'Renamed MpConstants typecode methods for compatibility with GemStone.https://github.com/msgpack/msgpack-smalltalk/issues/4' id '7672363c-2b3d-422c-a18d-63de7ceb21ba' date '18 May 2015' time '10:54:43.647181 am' author 'MasashiUmezawa' ancestors ((name 'MessagePack-Core-mu.31' message '- Ext and Fixext encoding/decoding are now working' id '958b6113-8b9b-214c-a28e-38c991a8b70b' date '8 December 2013' time '3:47:05.753 pm' author 'mu' ancestors () stepChildren ())) stepChildren ())) stepChildren ())
1+
(name 'MessagePack-Core-MasashiUmezawa.34' message 'MpSettings>>formatVersion -> 2013 is now default' id '51579c03-5587-47f1-9ebf-8a5ef7470230' date '21 June 2015' time '4:34:16.532914 pm' author 'MasashiUmezawa' ancestors ((name 'MessagePack-Core-MasashiUmezawa.33' message 'Fixed a mapping bug in MpDecodeTypeMapper>>bytesAsString' id 'd6135ce8-d710-444d-b3b0-2a6c24168765' date '23 May 2015' time '11:36:39.85456 pm' author 'MasashiUmezawa' ancestors ((name 'MessagePack-Core-MasashiUmezawa.32' message 'Renamed MpConstants typecode methods for compatibility with GemStone.https://github.com/msgpack/msgpack-smalltalk/issues/4' id '7672363c-2b3d-422c-a18d-63de7ceb21ba' date '18 May 2015' time '10:54:43.647181 am' author 'MasashiUmezawa' ancestors ((name 'MessagePack-Core-mu.31' message '- Ext and Fixext encoding/decoding are now working' id '958b6113-8b9b-214c-a28e-38c991a8b70b' date '8 December 2013' time '3:47:05.753 pm' author 'mu' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())

repository/MessagePackTest.package/MpSettingsTestCase.class/instance/testPackStringArrayAsArrayOfBytes.st

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ testing
22
testPackStringArrayAsArrayOfBytes
33
"self debug: #testPackStringArrayAsArrayOfBytes"
44
| bytes |
5-
self should: [self simpleStringContainedArray messagePacked] raise: MpError.
5+
self should: [self simpleStringContainedArray messagePacked: [:settings | settings legacyFormat]] raise: MpError.
66

7-
bytes := self simpleStringContainedArray messagePacked: [:settings | settings stringAsBytes: true].
7+
bytes := self simpleStringContainedArray messagePacked: [:settings | settings
8+
legacyFormat;
9+
stringAsBytes: true].
810

9-
self assert: (bytes = (self simpleStringContainedArray collect: [:each | (MpPortableUtil default bytesFromString: each)]) messagePacked)
11+
self assert: (bytes = ((self simpleStringContainedArray collect: [:each | each asByteArray])
12+
messagePacked: [:settings | settings legacyFormat]))
1013

1114

repository/MessagePackTest.package/MpSettingsTestCase.class/instance/testPackStringAsBytes.st

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ testing
22
testPackStringAsBytes
33
"self debug: #testPackStringAsBytes"
44
| bytes |
5-
self should: [self simpleString messagePacked] raise: MpError.
5+
self should: [self simpleString messagePacked:[:se | se legacyFormat]] raise: MpError.
66

7-
bytes := self simpleString messagePacked: [:settings | settings stringAsBytes: true].
7+
bytes := self simpleString messagePacked: [:settings | settings legacyFormat; stringAsBytes: true].
88

9-
self assert: (bytes = (MpPortableUtil default bytesFromString: self simpleString) messagePacked)
9+
self assert: (bytes = (self simpleString asByteArray messagePacked:[:se | se legacyFormat])).
10+
11+
self deny: (bytes = (self simpleString asByteArray messagePacked))
1012

1113

repository/MessagePackTest.package/MpSettingsTestCase.class/instance/testPackUnpackComplexIdentityDictionary.st

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ testPackUnpackComplexIdentityDictionary
44
| bytes convertedDic unpacked1 unpacked2 |
55
self should: [self complexIdentityDictionary messagePacked] raise: MpError.
66

7-
bytes := self complexIdentityDictionary messagePacked: [:se | se stringAsBytes: true; encodeMode: #loose].
7+
bytes := self complexIdentityDictionary messagePacked: [:se | se legacyFormat; stringAsBytes: true; encodeMode: #loose].
88

99
convertedDic := self complexDictionaryAfterConverted.
1010

11-
unpacked1 := Object fromMessagePack: bytes setting: [:se | se bytesAsString: true].
12-
unpacked2 := Object fromMessagePack: convertedDic messagePacked setting: [:se | se bytesAsString: true].
11+
unpacked1 := Object fromMessagePack: bytes setting: [:se | se legacyFormat; bytesAsString: true].
12+
unpacked2 := Object fromMessagePack: (convertedDic messagePacked: [:se | se legacyFormat]) setting: [:se | se legacyFormat; bytesAsString: true].
1313

1414
self should: [self collectionEquals: unpacked1 with: unpacked2]
1515

repository/MessagePackTest.package/MpSettingsTestCase.class/instance/testPackUnpackSimpleIdentityDictionary.st

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ testPackUnpackSimpleIdentityDictionary
44
| bytes convertedDic unpacked1 unpacked2 |
55
self should: [self simpleIdentityDictionary messagePacked] raise: MpError.
66

7-
bytes := self simpleIdentityDictionary messagePacked: [:se | se stringAsBytes: true; encodeMode: #loose].
7+
bytes := self simpleIdentityDictionary messagePacked: [:se | se legacyFormat; stringAsBytes: true; encodeMode: #loose].
88

99
convertedDic := Dictionary new.
1010
self simpleIdentityDictionary keysAndValuesDo: [:k :v | convertedDic at: (MpPortableUtil default bytesFromString: k) put: (MpPortableUtil default bytesFromString: v)].
1111

12-
unpacked1 := Object fromMessagePack: bytes setting: [:se | se bytesAsString: true].
13-
unpacked2 := Object fromMessagePack: convertedDic messagePacked setting: [:se | se bytesAsString: true].
12+
unpacked1 := Object fromMessagePack: bytes setting: [:se | se legacyFormat; bytesAsString: true].
13+
unpacked2 := Object fromMessagePack: (convertedDic messagePacked: [:se | se legacyFormat] ) setting: [:se | se legacyFormat; bytesAsString: true].
1414

1515
self should: [self collectionEquals: unpacked1 with: unpacked2]
1616

repository/MessagePackTest.package/MpSettingsTestCase.class/instance/testUnpackBytesAsString.st

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ testing
22
testUnpackBytesAsString
33
"self debug: #testUnpackBytesAsString"
44
| bytes unpackedAsByteArrays unpacked |
5-
bytes := self simpleStringContainedArray messagePacked: [:se | se stringAsBytes: true].
6-
unpackedAsByteArrays := Object fromMessagePack: bytes.
7-
self assert: (unpackedAsByteArrays = (self simpleStringContainedArray collect: [:each | MpPortableUtil default bytesFromString: each])).
5+
bytes := self simpleStringContainedArray messagePacked: [:se | se legacyFormat; stringAsBytes: true].
6+
unpackedAsByteArrays := Object fromMessagePack: bytes setting: [:se | se legacyFormat].
7+
self assert: (unpackedAsByteArrays = (self simpleStringContainedArray collect: [:each | each asByteArray])).
88

9-
unpacked := Object fromMessagePack: bytes setting: [:se | se bytesAsString: true].
9+
unpacked := Object fromMessagePack: bytes setting: [:se | se legacyFormat; bytesAsString: true].
1010
self assert: (unpacked = self simpleStringContainedArray)
1111

1212

repository/MessagePackTest.package/MpSettingsTestCase.class/methodProperties.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
"simpleStringContainedArray" : "MasashiUmezawa 2/2/2013 21:16",
1515
"stringSizes" : "MasashiUmezawa 2/2/2013 21:13",
1616
"stringsArray" : "MasashiUmezawa 2/2/2013 21:17",
17-
"testPackStringArrayAsArrayOfBytes" : "MasashiUmezawa 2/2/2013 21:17",
18-
"testPackStringAsBytes" : "MasashiUmezawa 2/2/2013 20:56",
17+
"testPackStringArrayAsArrayOfBytes" : "MasashiUmezawa 6/21/2015 16:32",
18+
"testPackStringAsBytes" : "MasashiUmezawa 6/21/2015 16:26",
1919
"testPackUnknownContainedArray" : "MasashiUmezawa 2/2/2013 21:03",
2020
"testPackUnknownContainedDictionary" : "MasashiUmezawa 2/2/2013 21:07",
21-
"testPackUnpackComplexIdentityDictionary" : "MasashiUmezawa 2/2/2013 21:50",
22-
"testPackUnpackSimpleIdentityDictionary" : "MasashiUmezawa 2/2/2013 21:35",
21+
"testPackUnpackComplexIdentityDictionary" : "MasashiUmezawa 6/21/2015 20:30",
22+
"testPackUnpackSimpleIdentityDictionary" : "MasashiUmezawa 6/21/2015 20:31",
2323
"testPackUnpackStrings" : "MasashiUmezawa 2/2/2013 21:21",
24-
"testUnpackBytesAsString" : "MasashiUmezawa 2/2/2013 22:00" } }
24+
"testUnpackBytesAsString" : "MasashiUmezawa 6/21/2015 16:29" } }

0 commit comments

Comments
 (0)