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

Function TestLimitingConsumerOnString

util/string/split_ut.cpp:100–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98using TStrokaConsumer = TContainerConsumer<TVector<TString>>;
99
100void TestLimitingConsumerOnString(TVector<TString>& good, const char* str, const char* d, size_t n, const char* last) {
101 TVector<TString> test;
102 TStrokaConsumer consumer(&test);
103 TLimitingConsumer<TStrokaConsumer, const char> limits(n, &consumer);
104 TCharDelimiter<const char> delim(*d);
105 SplitString(str, delim, limits);
106 Cmp(good, test);
107 UNIT_ASSERT_EQUAL(good, test);
108 UNIT_ASSERT_EQUAL(TString(limits.Last), TString(last)); // Quite unobvious behaviour. Why the last token is not added to slave consumer?
109}
110
111void TestLimitingConsumerOnRange(TVector<TString>& good, const char* b, const char* e, const char* d, size_t n, const char* last) {
112 TVector<TString> test;

Callers 1

Y_UNIT_TESTFunction · 0.85

Calls 2

CmpFunction · 0.85
SplitStringFunction · 0.70

Tested by

no test coverage detected