summaryrefslogtreecommitdiff
path: root/test/libapt/strutil_test.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-09-23 15:47:44 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-09-23 15:47:44 +0200
commitdb1d1c32149177c0b6ca49e5107ab1f5fd364660 (patch)
treeb06b22a9c92455b32889c88407f4190113a5cdd9 /test/libapt/strutil_test.cc
parent916b89109cd77728004819d4705778e3dc489b2e (diff)
parentc511c5e8ed3f59ddee1b174b39e5cc16a2f11922 (diff)
Merge remote-tracking branch 'upstream/debian/experimental' into feature/acq-trans
Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h methods/copy.cc test/integration/test-hashsum-verification
Diffstat (limited to 'test/libapt/strutil_test.cc')
-rw-r--r--test/libapt/strutil_test.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/libapt/strutil_test.cc b/test/libapt/strutil_test.cc
index 1c2f0abac..8dd9114ec 100644
--- a/test/libapt/strutil_test.cc
+++ b/test/libapt/strutil_test.cc
@@ -19,6 +19,21 @@ TEST(StrUtilTest,DeEscapeString)
EXPECT_EQ("foo\\ x", DeEscapeString("foo\\\\ x"));
EXPECT_EQ("\\foo\\", DeEscapeString("\\\\foo\\\\"));
}
+TEST(StrUtilTest,StringStrip)
+{
+ EXPECT_EQ("", APT::String::Strip(""));
+ EXPECT_EQ("foobar", APT::String::Strip("foobar"));
+ EXPECT_EQ("foo bar", APT::String::Strip("foo bar"));
+
+ EXPECT_EQ("", APT::String::Strip(" "));
+ EXPECT_EQ("", APT::String::Strip(" \r\n \t "));
+
+ EXPECT_EQ("foo bar", APT::String::Strip("foo bar "));
+ EXPECT_EQ("foo bar", APT::String::Strip("foo bar \r\n \t "));
+ EXPECT_EQ("foo bar", APT::String::Strip("\r\n \t foo bar"));
+ EXPECT_EQ("bar foo", APT::String::Strip("\r\n \t bar foo \r\n \t "));
+ EXPECT_EQ("bar \t\r\n foo", APT::String::Strip("\r\n \t bar \t\r\n foo \r\n \t "));
+}
TEST(StrUtilTest,StringSplitBasic)
{
std::vector<std::string> result = StringSplit("", "");