Skip to content

Commit

Permalink
Fix handling of symbols in serialization (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
ararslan authored and jrevels committed Sep 26, 2019
1 parent 393c96d commit 4142443
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ struct PointerString
len::UInt64
end

Base.length(s::PointerString) = s.len
Base.sizeof(s::PointerString) = s.len

Base.write(io::IO, s::PointerString) = Base.unsafe_write(io, s.ptr, s.len)

Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ end
@test can_round_trip(join(rand(Char, typemax(UInt8) + 1)), String)
@test can_round_trip(join(rand(Char, typemax(UInt16) + 1)), String)

let s = :wake_after_sleep_onset_percentage
@test can_round_trip(s, Symbol, s, string(s))
end

# BinaryType

struct ByteVec
Expand Down

0 comments on commit 4142443

Please sign in to comment.