| 24 | } |
| 25 | |
| 26 | void TestRemoveAll() { |
| 27 | static const struct T { |
| 28 | const char* Str; |
| 29 | char Ch; |
| 30 | const char* Result; |
| 31 | } tests[] = { |
| 32 | {"", 'x', ""}, |
| 33 | {"hello world", 'h', "ello world"}, |
| 34 | {"hello world", 'l', "heo word"}, |
| 35 | {"hello world", 'x', "hello world"}, |
| 36 | }; |
| 37 | |
| 38 | for (const T* t = tests; t != std::end(tests); ++t) { |
| 39 | TString str(t->Str); |
| 40 | RemoveAll(str, t->Ch); |
| 41 | UNIT_ASSERT_EQUAL(t->Result, str); |
| 42 | } |
| 43 | } |
| 44 | }; |
| 45 | |
| 46 | UNIT_TEST_SUITE_REGISTRATION(TStrUtilTest); |