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

24 lines
648 B
Plaintext
Raw Normal View History

2015-01-25 11:08:34 +00:00
process main {
explode("FOO", "aaaFOObbbFOOcccFOOddd") l;
val_equal(l, {"aaa", "bbb", "ccc", "ddd"}) a;
assert(a);
explode("FOO", "FOObbbFOOFOO") l;
val_equal(l, {"", "bbb", "", ""}) a;
assert(a);
explode("FOO", "foo") l;
val_equal(l, {"foo"}) a;
assert(a);
explode("FOO", "FOO") l;
val_equal(l, {"", ""}) a;
assert(a);
explode("participate in parachute", "parachute in participation of participate in parachuteparparticipate in parachute participate in parachut") l;
val_equal(l, {"parachute in participation of ", "par", " participate in parachut"}) a;
assert(a);
exit("0");
}