19 lines
590 B
C++
19 lines
590 B
C++
#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");
|
||
|
|
}
|