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
8 changes: 7 additions & 1 deletion tdd_intro/homework/02_ternary_numbers/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int IntFromTernaryNumberString(const std::string& ternaryNumberString)
return (ternaryNumberString.front() - '0') * 3;
}

return ternaryNumberString.back() - '0';
Copy link
Collaborator

Choose a reason for hiding this comment

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

не совсем понял с чем связано это изменение на этапе красного теста

return ternaryNumberString.front() - '0';
Copy link
Collaborator

Choose a reason for hiding this comment

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

как только ты добавляешь front() или back() сразу стоит задуматься о тесте с пустой строкой :)

}

TEST(IntFromTernaryNumberString, one)
Expand All @@ -48,3 +48,9 @@ TEST(IntFromTernaryNumberString, decimal6ForTernary20)
{
EXPECT_EQ(6, IntFromTernaryNumberString("20"));
}

TEST(IntFromTernaryNumberString, decimal9ForTernary100)
{
EXPECT_EQ(9, IntFromTernaryNumberString("100"));
}