Add CBOR UUID encoding and decoding tests.

remotes/dev/pr-uuid
Karchnu 2021-06-21 18:53:04 +02:00
parent 1ddcd6678f
commit fe3d434209
1 changed files with 15 additions and 0 deletions

15
spec/cbor_uuid.cr Normal file
View File

@ -0,0 +1,15 @@
require "./spec_helper"
describe CBOR do
describe "UUID" do
it "UUID#to_cbor" do
uuid = UUID.new "fc47eb8e-b13c-481e-863a-8f8c47a550f2"
uuid.to_cbor.hexstring.should eq "50fc47eb8eb13c481e863a8f8c47a550f2"
end
it "UUID#from_cbor" do
uuid = UUID.from_cbor "50fc47eb8eb13c481e863a8f8c47a550f2".hexbytes
uuid.to_cbor.hexstring.should eq "50fc47eb8eb13c481e863a8f8c47a550f2"
end
end
end