MCPcopy Create free account
hub / github.com/catboost/catboost / Y_UNIT_TEST

Function Y_UNIT_TEST

tools/enum_parser/parse_enum/ut/enums.cpp:50–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 }
49
50 Y_UNIT_TEST(ToStringTest) {
51 // ESimple
52 CheckToString(Http, "Http");
53 CheckToString(Https, "Https");
54 CheckToString(ItemCount, "ItemCount");
55
56 // ESimpleWithComma
57 CheckToString(ESimpleWithComma::Http, "Http");
58 CheckToString(ESimpleWithComma::Https, "Https");
59 CheckToString(ESimpleWithComma::Http2, "Http"); // Http2 is an alias for Http
60 CheckToString(ESimpleWithComma::ItemCount, "ItemCount");
61
62 // ECustomAliases
63 CheckToString(CAHttp, "http");
64 CheckToString(CAHttps, "https");
65 CheckToString(CAItemCount, "CAItemCount");
66
67 // EMultipleAliases
68 CheckToString(MAHttp, "http://");
69 CheckToString(MAHttps, "https://");
70 CheckToString(MAItemCount, "MAItemCount");
71
72 // EDuplicateKeys
73 CheckToString(Key0, "Key0");
74 CheckToString(Key0Second, "Key0"); // obtain FIRST encountered value with such integer key
75 CheckToString(Key1, "Key1");
76 CheckToString(Key2, "k2");
77 CheckToString(Key3, "k2"); // we CANNOT obtain "k3" here (as Key3 == Key2)
78 }
79
80 template<typename T>
81 void CheckFromString(const TString& strValue, const T& value) {

Callers

nothing calls this directly

Calls 11

CheckToStringFunction · 0.85
CheckFromStringFunction · 0.85
CheckTryFromStringFunction · 0.85
ToStringBufFunction · 0.85
IsSortedFunction · 0.85
sizeMethod · 0.45
atMethod · 0.45
containsMethod · 0.45
InitMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected