[util/string] Test that Split().Collect(&v) doesn't clear v.
@@ -182,6 +182,14 @@ Y_UNIT_TEST_SUITE(StringSplitter) {
UNIT_ASSERT_VALUES_EQUAL(expected, actual);
}
+ Y_UNIT_TEST(TestStringSplitterCollectDoesntClear) {
+ TVector<TString> v;
+ StringSplitter("1 2 3").Split(' ').Collect(&v);
+ UNIT_ASSERT_VALUES_EQUAL(v.size(), 3);
+ StringSplitter("4 5").Split(' ').Collect(&v);
+ UNIT_ASSERT_VALUES_EQUAL(v.size(), 5);
+ }
+
Y_UNIT_TEST(TestSplitStringInto) {
int a = -1;
TStringBuf s;
