be tolerant of curly braces on input, but don't use them on output.
This commit is contained in:
parent
026a4a16de
commit
cc40307adb
|
@ -31,7 +31,7 @@
|
|||
TEST(UUID, ver4fromString)
|
||||
{
|
||||
// from online generator
|
||||
auto str = std::string("{c2ffda84-0743-4d3f-8299-e2ba3a09e16c}");
|
||||
auto str = std::string("c2ffda84-0743-4d3f-8299-e2ba3a09e16c");
|
||||
auto uuid = UUID::uuid(str);
|
||||
|
||||
ASSERT_EQ(uuid.type(), UUID::RFC4122);
|
||||
|
|
|
@ -146,8 +146,8 @@ std::string uuid::string() const
|
|||
str.reserve(str.length() + 6);
|
||||
for (int idx : {8, 13, 18, 23})
|
||||
str.insert(idx, "-");
|
||||
str.insert(0, "{");
|
||||
str.insert(str.length(), "}");
|
||||
// str.insert(0, "{");
|
||||
// str.insert(str.length(), "}");
|
||||
return str;
|
||||
};
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ public:
|
|||
|
||||
// output
|
||||
std::string hex() const; // '12345678123456781234567812345678'
|
||||
std::string string() const;// '{12345678-1234-5678-1234-567812345678}'
|
||||
std::string string() const;// '12345678-1234-5678-1234-567812345678'
|
||||
std::string urn() const; // 'urn:uuid:12345678-1234-5678-1234-567812345678'
|
||||
|
||||
// creators
|
||||
|
|
Loading…
Reference in New Issue