| 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) { |
nothing calls this directly
no test coverage detected