diff options
| author | JosJuice <josjuice@gmail.com> | 2016-11-27 11:18:27 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2016-11-27 22:11:14 +0100 |
| commit | 0c6fd47460cb59c1b58c8870a4d2f05c23d8f357 (patch) | |
| tree | 8e7cd6f72f9a8c7daf7aec4d10affc9eb7df89c6 /Source/UnitTests/Common/StringUtilTest.cpp | |
| parent | 841e5893f4babccdd28a60ee4e63532f030daf53 (diff) | |
Add unit test for StringUtil's newly added JoinStrings
Diffstat (limited to 'Source/UnitTests/Common/StringUtilTest.cpp')
| -rw-r--r-- | Source/UnitTests/Common/StringUtilTest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/UnitTests/Common/StringUtilTest.cpp b/Source/UnitTests/Common/StringUtilTest.cpp new file mode 100644 index 0000000000..603c99d80c --- /dev/null +++ b/Source/UnitTests/Common/StringUtilTest.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({"?", "?"}, "?")); +} |
