about summary refs log blame commit diff stats
path: root/062array.mu
blob: c54020c05e0cdcb0cf089557e1546198d2e15e71 (plain) (tree)
("abc,def,ghi", ","); CHECK_EQ(result.size(), 3); CHECK_EQ(result.at(0), "abc"); CHECK_EQ(result.at(1), "def"); CHECK_EQ(result.at(2), "ghi"); } void test_split_handles_multichar_delim() { vector<string> result = split("abc,,def,,ghi", ",,"); CHECK_EQ(result.size(), 3); CHECK_EQ(result.at(0), "abc"); CHECK_EQ(result.at(1), "def"); CHECK_EQ(result.at(2), "ghi"); } void test_trim() { CHECK_EQ(trim(""), ""); CHECK_EQ(trim(" "), ""); CHECK_EQ(trim(" "), ""); CHECK_EQ(trim("a"), "a"); CHECK_EQ(trim(" a"), "a"); CHECK_EQ(trim(" a"), "a"); CHECK_EQ(trim(" ab"), "ab"); CHECK_EQ(trim("a "), "a"); CHECK_EQ(trim("a "), "a"); CHECK_EQ(trim("ab "), "ab"); CHECK_EQ(trim(" a "), "a"); CHECK_EQ(trim(" a "), "a"); CHECK_EQ(trim(" ab "), "ab"); }