Add unit test for StringUtil's newly added JoinStrings
This commit is contained in:
parent
841e5893f4
commit
0c6fd47460
|
@ -9,4 +9,5 @@ add_dolphin_test(FixedSizeQueueTest FixedSizeQueueTest.cpp)
|
|||
add_dolphin_test(FlagTest FlagTest.cpp)
|
||||
add_dolphin_test(MathUtilTest MathUtilTest.cpp)
|
||||
add_dolphin_test(NandPathsTest NandPathsTest.cpp)
|
||||
add_dolphin_test(StringUtilTest StringUtilTest.cpp)
|
||||
add_dolphin_test(x64EmitterTest x64EmitterTest.cpp)
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright 2016 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
TEST(StringUtil, JoinStrings)
|
||||
{
|
||||
EXPECT_EQ("", JoinStrings({}, ", "));
|
||||
EXPECT_EQ("a", JoinStrings({"a"}, ","));
|
||||
EXPECT_EQ("ab", JoinStrings({"a", "b"}, ""));
|
||||
EXPECT_EQ("a, bb, c", JoinStrings({"a", "bb", "c"}, ", "));
|
||||
EXPECT_EQ("???", JoinStrings({"?", "?"}, "?"));
|
||||
}
|
Loading…
Reference in New Issue