summaryrefslogtreecommitdiff
path: root/test/libapt
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-11-29 08:35:05 +0100
committerMichael Vogt <mvo@debian.org>2013-11-29 08:37:54 +0100
commitcf993341c2067ee091cfd51e5da0e237babce171 (patch)
tree1ece0eaaaea76acf5fba1c74054873d80ef633b5 /test/libapt
parenta8f671c17a7f34e80a49bf367bceaa009551b066 (diff)
add "APT::String::Endswith" and automatic adding of ".list" in apt edit-source
Diffstat (limited to 'test/libapt')
-rw-r--r--test/libapt/strutil_test.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/libapt/strutil_test.cc b/test/libapt/strutil_test.cc
index 110a20d27..8215654d0 100644
--- a/test/libapt/strutil_test.cc
+++ b/test/libapt/strutil_test.cc
@@ -69,5 +69,23 @@ int main(int argc,char *argv[])
result = StringSplit(input, "");
equals(result.size(), 0);
+ // endswith
+ bool b;
+ input = "abcd";
+ b = APT::String::Endswith(input, "d");
+ equals(b, true);
+
+ b = APT::String::Endswith(input, "cd");
+ equals(b, true);
+
+ b = APT::String::Endswith(input, "abcd");
+ equals(b, true);
+
+ b = APT::String::Endswith(input, "x");
+ equals(b, false);
+
+ b = APT::String::Endswith(input, "abcndefg");
+ equals(b, false);
+
return 0;
}