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");
}
