tor-android/external/badvpn_dns/ncd/tests/value_substr.ncd

26 lines
428 B
Plaintext
Raw Normal View History

2015-01-25 11:08:34 +00:00
process foo {
value("0123456789") str;
str->substr("0") sub;
strcmp(sub, str) a;
assert(a);
str->substr("1") sub;
strcmp(sub, "123456789") a;
assert(a);
str->substr("1", "0") sub;
strcmp(sub, "") a;
assert(a);
str->substr("1", "9") sub;
strcmp(sub, "123456789") a;
assert(a);
str->substr("1", "8") sub;
strcmp(sub, "12345678") a;
assert(a);
exit("0");
}