From cf993341c2067ee091cfd51e5da0e237babce171 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 29 Nov 2013 08:35:05 +0100 Subject: add "APT::String::Endswith" and automatic adding of ".list" in apt edit-source --- test/libapt/strutil_test.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/libapt') 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; } -- cgit v1.2.3