]> git.saurik.com Git - apt.git/blobdiff - test/libapt/strutil_test.cc
move defines for version to macros.h
[apt.git] / test / libapt / strutil_test.cc
index 110a20d277dd49ecb7f747e704fa9433c2621e4b..a4516e7a154306a52b9e02a4a078bcc2f91953e7 100644 (file)
@@ -2,7 +2,7 @@
 
 #include "assert.h"
 
-int main(int argc,char *argv[])
+int main()
 {
    std::string input, output, expected;
 
@@ -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;
 }