Skip to content

Commit

Permalink
test: stringhelper testcase (#790)
Browse files Browse the repository at this point in the history
- testcase added for stringhelper module for code coverage

Signed-off-by: Guru Mehar Rachaputi <[email protected]>
  • Loading branch information
00thirdeye00 authored Jul 5, 2024
1 parent 4f6d66f commit 1b58300
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/common/StringHelperTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ TEST_F(StringHelperTest, splitStringByNewLine)
ASSERT_EQ(result[3], "source");
}

TEST_F(StringHelperTest, joinStringViewsWithoutString)
{
const std::vector<std::string_view> input{};

const auto result = common::join(input);

ASSERT_EQ(result, "");
}

TEST_F(StringHelperTest, joinStringViewsIntoVectorBySpace)
{
const std::vector<std::string_view> input{"Join", "faker", "development!"};
Expand All @@ -52,6 +61,15 @@ TEST_F(StringHelperTest, joinStringViewsIntoVectorByNewLine)
ASSERT_EQ(result, "Join\nfaker\ndevelopment!");
}

TEST_F(StringHelperTest, joinStringsWithoutString)
{
const std::vector<std::string> input{};

const auto result = common::joinString(input);

ASSERT_EQ(result, "");
}

TEST_F(StringHelperTest, joinStringsIntoVectorBySpace)
{
const std::vector<std::string> input{"Join", "faker", "development!"};
Expand Down

0 comments on commit 1b58300

Please sign in to comment.