[ox/std] Add UUID fromString
This commit is contained in:
27
deps/ox/src/ox/std/test/tests.cpp
vendored
27
deps/ox/src/ox/std/test/tests.cpp
vendored
@@ -60,6 +60,8 @@ static std::map<ox::String, ox::Error(*)()> tests = {
|
||||
oxAssert(s == "AB9C", "BString append broken");
|
||||
s = "asdf";
|
||||
oxAssert(s == "asdf", "String assign broken");
|
||||
oxAssert(s != "aoeu", "String assign broken");
|
||||
oxAssert(s.len() == 4, "String assign broken");
|
||||
return OxError(0);
|
||||
}
|
||||
},
|
||||
@@ -156,6 +158,29 @@ static std::map<ox::String, ox::Error(*)()> tests = {
|
||||
return OxError(0);
|
||||
}
|
||||
},
|
||||
{
|
||||
"FromHex",
|
||||
[] {
|
||||
oxExpect(ox::detail::fromHex("01").unwrap(), 0x01);
|
||||
oxExpect(ox::detail::fromHex("02").unwrap(), 0x02);
|
||||
oxExpect(ox::detail::fromHex("03").unwrap(), 0x03);
|
||||
oxExpect(ox::detail::fromHex("04").unwrap(), 0x04);
|
||||
oxExpect(ox::detail::fromHex("05").unwrap(), 0x05);
|
||||
oxExpect(ox::detail::fromHex("06").unwrap(), 0x06);
|
||||
oxExpect(ox::detail::fromHex("07").unwrap(), 0x07);
|
||||
oxExpect(ox::detail::fromHex("08").unwrap(), 0x08);
|
||||
oxExpect(ox::detail::fromHex("0d").unwrap(), 0x0d);
|
||||
oxExpect(ox::detail::fromHex("0e").unwrap(), 0x0e);
|
||||
oxExpect(ox::detail::fromHex("0f").unwrap(), 0x0f);
|
||||
oxExpect(ox::detail::fromHex("0F").unwrap(), 0x0f);
|
||||
oxExpect(ox::detail::fromHex("fF").unwrap(), 0xff);
|
||||
oxExpect(ox::detail::fromHex("ff").unwrap(), 0xff);
|
||||
oxExpect(ox::detail::fromHex("a0").unwrap(), 0xa0);
|
||||
oxExpect(ox::detail::fromHex("93").unwrap(), 0x93);
|
||||
oxExpect(ox::detail::fromHex("40").unwrap(), 0x40);
|
||||
return OxError(0);
|
||||
}
|
||||
},
|
||||
{
|
||||
"ToHex",
|
||||
[] {
|
||||
@@ -168,7 +193,7 @@ static std::map<ox::String, ox::Error(*)()> tests = {
|
||||
oxExpect(ox::detail::toHex(0x07), "07");
|
||||
oxExpect(ox::detail::toHex(0x08), "08");
|
||||
oxExpect(ox::detail::toHex(0x0d), "0d");
|
||||
oxExpect(ox::detail::toHex(0x0e), "03");
|
||||
oxExpect(ox::detail::toHex(0x0e), "0e");
|
||||
oxExpect(ox::detail::toHex(0x0f), "0f");
|
||||
oxExpect(ox::detail::toHex(0x93), "93");
|
||||
oxExpect(ox::detail::toHex(0x40), "40");
|
||||
|
||||
Reference in New Issue
Block a user