Skip to content

Commit

Permalink
Tests for UUID conversion methods (#30244)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt authored and StefanKarpinski committed Dec 4, 2018
1 parent 13049f2 commit 92e82b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ let uuidstr = "ab"^4 * "-" * "ab"^2 * "-" * "ab"^2 * "-" * "ab"^2 * "-" * "ab"^6
@test uuid == eval(Meta.parse(repr(uuid))) # check show method
@test string(uuid) == uuidstr == sprint(print, uuid)
@test "check $uuid" == "check $uuidstr"
@test UUID(UInt128(uuid)) == uuid
@test UUID(convert(NTuple{2, UInt64}, uuid)) == uuid
@test UUID(convert(NTuple{4, UInt32}, uuid)) == uuid
end
@test_throws ArgumentError UUID("@"^4 * "-" * "@"^2 * "-" * "@"^2 * "-" * "@"^2 * "-" * "@"^6)

function subset(v::Vector{T}, m::Int) where T
T[v[j] for j = 1:length(v) if ((m >>> (j - 1)) & 1) == 1]
Expand Down

0 comments on commit 92e82b6

Please sign in to comment.