msgpack 0.7.0-java → 0.7.1-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/msgpack/msgpack.jar +0 -0
- data/lib/msgpack/version.rb +1 -1
- data/spec/packer_spec.rb +30 -0
- data/spec/unpacker_spec.rb +27 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f104acf790f0b8dae314e3357dec2e0cdcaabb30
|
4
|
+
data.tar.gz: b4b4467691d56ebe036bb368458e2520988e7637
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee4738586a4122fe0c6037db59c23f69b8322afe22d8b84da0d37f92e97d03f632efac55925139b342486a415ec93e684a5e3a118ed3eddc49925a42882de50e
|
7
|
+
data.tar.gz: efa2e7608574a13e4f2adba873bc5c32b24b467c3411478e3383ea72cb789917f59b1c51d6a929a00573edf6c40ab9755c9d0c8276d9d6d0b7c638299336e68c
|
data/lib/msgpack/msgpack.jar
CHANGED
Binary file
|
data/lib/msgpack/version.rb
CHANGED
data/spec/packer_spec.rb
CHANGED
@@ -223,4 +223,34 @@ describe MessagePack::Packer do
|
|
223
223
|
expect(two[:packer]).to eq(:to_msgpack_ext)
|
224
224
|
end
|
225
225
|
end
|
226
|
+
|
227
|
+
describe "ext formats" do
|
228
|
+
[1, 2, 4, 8, 16].zip([0xd4, 0xd5, 0xd6, 0xd7, 0xd8]).each do |n,b|
|
229
|
+
it "msgpack fixext #{n} format" do
|
230
|
+
MessagePack::ExtensionValue.new(1, "a"*n).to_msgpack.should ==
|
231
|
+
[b, 1].pack('CC') + "a"*n
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
it "msgpack ext 8 format" do
|
236
|
+
MessagePack::ExtensionValue.new(1, "").to_msgpack.should ==
|
237
|
+
[0xc7, 0, 1].pack('CCC') + ""
|
238
|
+
MessagePack::ExtensionValue.new(-1, "a"*255).to_msgpack.should ==
|
239
|
+
[0xc7, 255, -1].pack('CCC') + "a"*255
|
240
|
+
end
|
241
|
+
|
242
|
+
it "msgpack ext 16 format" do
|
243
|
+
MessagePack::ExtensionValue.new(1, "a"*256).to_msgpack.should ==
|
244
|
+
[0xc8, 256, 1].pack('CnC') + "a"*256
|
245
|
+
MessagePack::ExtensionValue.new(-1, "a"*65535).to_msgpack.should ==
|
246
|
+
[0xc8, 65535, -1].pack('CnC') + "a"*65535
|
247
|
+
end
|
248
|
+
|
249
|
+
it "msgpack ext 32 format" do
|
250
|
+
MessagePack::ExtensionValue.new(1, "a"*65536).to_msgpack.should ==
|
251
|
+
[0xc9, 65536, 1].pack('CNC') + "a"*65536
|
252
|
+
MessagePack::ExtensionValue.new(-1, "a"*65538).to_msgpack.should ==
|
253
|
+
[0xc9, 65538, -1].pack('CNC') + "a"*65538
|
254
|
+
end
|
255
|
+
end
|
226
256
|
end
|
data/spec/unpacker_spec.rb
CHANGED
@@ -260,6 +260,33 @@ describe MessagePack::Unpacker do
|
|
260
260
|
MessagePack.unpack([0xc6, 0x00, 0x00, 0x00, 0x02].pack('C*') + 'aa').should == "aa"
|
261
261
|
end
|
262
262
|
|
263
|
+
describe "ext formats" do
|
264
|
+
let(:unpacker) { MessagePack::Unpacker.new(allow_unknown_ext: true) }
|
265
|
+
|
266
|
+
[1, 2, 4, 8, 16].zip([0xd4, 0xd5, 0xd6, 0xd7, 0xd8]).each do |n,b|
|
267
|
+
it "msgpack fixext #{n} format" do
|
268
|
+
unpacker.feed([b, 1].pack('CC') + "a"*n).unpack.should == MessagePack::ExtensionValue.new(1, "a"*n)
|
269
|
+
unpacker.feed([b, -1].pack('CC') + "a"*n).unpack.should == MessagePack::ExtensionValue.new(-1, "a"*n)
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
it "msgpack ext 8 format" do
|
274
|
+
unpacker.feed([0xc7, 0, 1].pack('CCC')).unpack.should == MessagePack::ExtensionValue.new(1, "")
|
275
|
+
unpacker.feed([0xc7, 255, -1].pack('CCC') + "a"*255).unpack.should == MessagePack::ExtensionValue.new(-1, "a"*255)
|
276
|
+
end
|
277
|
+
|
278
|
+
it "msgpack ext 16 format" do
|
279
|
+
unpacker.feed([0xc8, 0, 1].pack('CnC')).unpack.should == MessagePack::ExtensionValue.new(1, "")
|
280
|
+
unpacker.feed([0xc8, 256, -1].pack('CnC') + "a"*256).unpack.should == MessagePack::ExtensionValue.new(-1, "a"*256)
|
281
|
+
end
|
282
|
+
|
283
|
+
it "msgpack ext 32 format" do
|
284
|
+
unpacker.feed([0xc9, 0, 1].pack('CNC')).unpack.should == MessagePack::ExtensionValue.new(1, "")
|
285
|
+
unpacker.feed([0xc9, 256, -1].pack('CNC') + "a"*256).unpack.should == MessagePack::ExtensionValue.new(-1, "a"*256)
|
286
|
+
unpacker.feed([0xc9, 65536, -1].pack('CNC') + "a"*65536).unpack.should == MessagePack::ExtensionValue.new(-1, "a"*65536)
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
263
290
|
class ValueOne
|
264
291
|
attr_reader :num
|
265
292
|
def initialize(num)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: msgpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-11-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|