2010-01-04 18:16:40 +00:00
|
|
|
#include <assert.h>
|
|
|
|
|
2010-06-03 18:44:55 +00:00
|
|
|
#include "../stringops.hpp"
|
2010-01-04 18:16:40 +00:00
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
assert(begins("abc", "a"));
|
|
|
|
assert(begins("abc", "ab"));
|
|
|
|
assert(begins("abc", "abc"));
|
|
|
|
assert(begins("abcd", "abc"));
|
|
|
|
|
|
|
|
assert(!begins("abc", "b"));
|
|
|
|
assert(!begins("abc", "bc"));
|
|
|
|
assert(!begins("abc", "bcd"));
|
|
|
|
assert(!begins("abc", "abcd"));
|
|
|
|
|
2010-02-17 15:45:55 +00:00
|
|
|
assert(ibegins("Abc", "a"));
|
|
|
|
assert(ibegins("aBc", "ab"));
|
|
|
|
assert(ibegins("abC", "abc"));
|
|
|
|
assert(ibegins("abcD", "abc"));
|
|
|
|
|
|
|
|
assert(!ibegins("abc", "b"));
|
|
|
|
assert(!ibegins("abc", "bc"));
|
|
|
|
assert(!ibegins("abc", "bcd"));
|
|
|
|
assert(!ibegins("abc", "abcd"));
|
|
|
|
|
|
|
|
assert(ends("abc", "c"));
|
|
|
|
assert(ends("abc", "bc"));
|
|
|
|
assert(ends("abc", "abc"));
|
|
|
|
assert(ends("abcd", "abcd"));
|
|
|
|
|
|
|
|
assert(!ends("abc", "b"));
|
|
|
|
assert(!ends("abc", "ab"));
|
|
|
|
assert(!ends("abc", "bcd"));
|
|
|
|
assert(!ends("abc", "abcd"));
|
|
|
|
|
|
|
|
assert(iends("Abc", "c"));
|
|
|
|
assert(iends("aBc", "bc"));
|
|
|
|
assert(iends("abC", "abc"));
|
|
|
|
assert(iends("abcD", "abcd"));
|
|
|
|
|
|
|
|
assert(!iends("abc", "b"));
|
|
|
|
assert(!iends("abc", "ab"));
|
|
|
|
assert(!iends("abc", "bcd"));
|
|
|
|
assert(!iends("abc", "abcd"));
|
|
|
|
|
2010-01-04 18:16:40 +00:00
|
|
|
return 0;
|
|
|
|
}
|