Add optimized version of count_words for default whitespace chars

This commit is contained in:
Richard Berger
2020-06-11 13:37:22 -04:00
parent 9945f73743
commit 6cb5345cd0
3 changed files with 42 additions and 1 deletions

View File

@ -28,6 +28,10 @@ TEST(Utils, count_words) {
ASSERT_EQ(utils::count_words("some text # comment"), 4);
}
TEST(Utils, count_words_non_default) {
ASSERT_EQ(utils::count_words("some text # comment", " #"), 3);
}
TEST(Utils, trim_and_count_words) {
ASSERT_EQ(utils::trim_and_count_words("some text # comment"), 2);
}