Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions tdd_intro/demo/02_word_count/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,12 @@ std::map<std::string, size_t> CountWords(const std::string& sentence)
return { { sentence, 1 } };
}

TEST(SplitTest, ReturnSameWordForOneWordSentence)
TEST(SplitTest, ReturnsNWordsForNWordsSentenceSentence)
{
EXPECT_EQ(std::vector<std::string>({"word"}), Split("word", " "));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

этот экспект должен идти отдельно, поскольку изолирует отдельный кейс отсутствия делимитера

}
TEST(SplitTest, ReturnsTwoWordsForTwoWordsSentence)
{
EXPECT_EQ(std::vector<std::string>({"word_a", "word_b"}), Split("word_a word_b", " "));
}
TEST(SplitTest, ReturnsNWordsForNWordsSentenceSentence)
{
EXPECT_EQ(std::vector<std::string>({"word_a", "word_b", "word_c"}), Split("word_a word_b word_c", " "));
EXPECT_EQ(std::vector<std::string>({"word_a", "word_b", "word_a"}), Split("word_a word_b word_a", " "));
}

TEST(CountWordsTest, ReturnsSameWordMapForOneWord)
Expand Down