From 81c91e6eb271763b143340433747efa2a721593b Mon Sep 17 00:00:00 2001 From: Karchnu Date: Sat, 28 Nov 2020 01:38:53 +0100 Subject: [PATCH] CBOR specs: UUID tests. --- spec/cbor_spec.cr | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/cbor_spec.cr b/spec/cbor_spec.cr index c2de2d8..56eaa99 100644 --- a/spec/cbor_spec.cr +++ b/spec/cbor_spec.cr @@ -58,6 +58,19 @@ describe CBOR do end end + 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 + + describe "CBOR library annotations and features" do it "Person#from_cbor with unmapped values" do h = Hash(String | Int32, String | Int32).new