summaryrefslogtreecommitdiff
path: root/Source/UnitTests/Common/StringUtilTest.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2016-11-29 18:34:22 +0100
committerGitHub <noreply@github.com>2016-11-29 18:34:22 +0100
commit3cfc49a613a0f8e137c251694c97f0f3589f3216 (patch)
tree158c4deb49e146888d1c1c0c8dd2252a7a8d7a01 /Source/UnitTests/Common/StringUtilTest.cpp
parent97ebb02a07dcbaf9efaab3f084cb8cb917b53ef5 (diff)
parent0c6fd47460cb59c1b58c8870a4d2f05c23d8f357 (diff)
Merge pull request #4472 from JosJuice/revert-absolute-path
IOS HLE: Replace broken path traversal prevention
Diffstat (limited to 'Source/UnitTests/Common/StringUtilTest.cpp')
-rw-r--r--Source/UnitTests/Common/StringUtilTest.cpp18
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({"?", "?"}, "?"));
+}