Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Serialization package for extserialize/deserialize #26

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Project.toml
Expand Up @@ -6,4 +6,5 @@ version = "0.2.0"
[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1 change: 1 addition & 0 deletions src/MsgPack.jl
@@ -1,5 +1,6 @@
module MsgPack

import Serialization: serialize, deserialize
import Compat: take!, xor

export pack, unpack, Ext
Expand Down
11 changes: 11 additions & 0 deletions test/runtests.jl
Expand Up @@ -116,3 +116,14 @@ b = rand(UInt8, 2^14)
b = rand(UInt8, 2^19)
@test ck_pack(Ext(-123, b, impltype=true),
vcat(0xc9, 0x00, 0x08, 0x00, 0x00, 0x85, b))

# extserialize
struct Point
x :: Int64
y :: Int64
end

b = Point(1, 2)
ser = MsgPack.extserialize(101, b)
deser = MsgPack.extdeserialize(ser)
@test deser == (101, b)