Initial Course
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#include "basic_io.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(BasicIo, JoinWords) {
|
||||
EXPECT_EQ(fundamentals::join_words({"C", "Plus", "Plus"}, '-'), "C-Plus-Plus");
|
||||
EXPECT_EQ(fundamentals::join_words({"solo"}, ','), "solo");
|
||||
EXPECT_EQ(fundamentals::join_words({}, ','), "");
|
||||
}
|
||||
|
||||
TEST(BasicIo, ParseIntegers) {
|
||||
EXPECT_EQ(fundamentals::parse_integers("1,2,3"), (std::vector<int>{1, 2, 3}));
|
||||
EXPECT_EQ(fundamentals::parse_integers("42"), (std::vector<int>{42}));
|
||||
}
|
||||
|
||||
TEST(BasicIo, FormatScore) {
|
||||
EXPECT_EQ(fundamentals::format_score("Alice", 150), "Alice scored 150 points");
|
||||
}
|
||||
Reference in New Issue
Block a user