dsII/extra/wolfpaw/
dsII/lib/cmds/admins/
dsII/lib/cmds/common/
dsII/lib/cmds/creators/include/
dsII/lib/cmds/creators/include/SCCS/
dsII/lib/daemon/services/
dsII/lib/doc/
dsII/lib/domains/Ylsrim/
dsII/lib/domains/Ylsrim/adm/
dsII/lib/domains/Ylsrim/armor/
dsII/lib/domains/Ylsrim/broken/
dsII/lib/domains/Ylsrim/fish/
dsII/lib/domains/Ylsrim/meal/
dsII/lib/domains/Ylsrim/npc/
dsII/lib/domains/Ylsrim/virtual/
dsII/lib/domains/Ylsrim/weapon/
dsII/lib/domains/campus/adm/
dsII/lib/domains/campus/etc/
dsII/lib/domains/campus/meals/
dsII/lib/domains/campus/npc/
dsII/lib/domains/campus/txt/
dsII/lib/domains/campus/txt/ai/charles/
dsII/lib/domains/campus/txt/ai/charles/bak2/
dsII/lib/domains/campus/txt/ai/charles/bak2/bak1/
dsII/lib/domains/campus/txt/ai/charly/
dsII/lib/domains/campus/txt/ai/charly/bak/
dsII/lib/domains/campus/txt/jenny/
dsII/lib/domains/default/creator/
dsII/lib/domains/default/doors/
dsII/lib/domains/default/etc/
dsII/lib/domains/default/weap/
dsII/lib/domains/town/doors/
dsII/lib/domains/town/txt/
dsII/lib/domains/town/virtual/
dsII/lib/lib/comp/
dsII/lib/lib/lvs/
dsII/lib/lib/user/
dsII/lib/lib/virtual/
dsII/lib/log/archive/
dsII/lib/log/chan/
dsII/lib/log/errors/
dsII/lib/log/open/
dsII/lib/obj/book_source/
dsII/lib/obj/include/
dsII/lib/realms/template/
dsII/lib/realms/template/area/armor/
dsII/lib/realms/template/area/npc/
dsII/lib/realms/template/area/obj/
dsII/lib/realms/template/area/room/
dsII/lib/realms/template/area/weap/
dsII/lib/realms/template/bak/
dsII/lib/realms/template/cmds/
dsII/lib/save/
dsII/lib/save/kills/o/
dsII/lib/secure/cfg/
dsII/lib/secure/cfg/classes/
dsII/lib/secure/cfg/races/SCCS/
dsII/lib/secure/cmds/creators/include/
dsII/lib/secure/cmds/players/
dsII/lib/secure/cmds/players/include/
dsII/lib/secure/daemon/include/
dsII/lib/secure/lib/
dsII/lib/secure/lib/include/
dsII/lib/secure/lib/net/
dsII/lib/secure/lib/net/include/
dsII/lib/secure/lib/std/
dsII/lib/secure/modules/
dsII/lib/secure/npc/
dsII/lib/secure/obj/include/
dsII/lib/secure/room/
dsII/lib/secure/save/boards/
dsII/lib/secure/save/postal/c/cratylus/
dsII/lib/secure/save/votes/
dsII/lib/secure/tmp/
dsII/lib/secure/verbs/creators/
dsII/lib/shadows/
dsII/lib/spells/
dsII/lib/tmp/
dsII/lib/verbs/admins/include/
dsII/lib/verbs/common/
dsII/lib/verbs/common/include/
dsII/lib/verbs/creators/include/
dsII/lib/verbs/players/include/SCCS/
dsII/lib/verbs/rooms/
dsII/lib/verbs/rooms/include/
dsII/lib/www/
dsII/v22.2b14/
dsII/v22.2b14/Win32/
dsII/v22.2b14/compat/
dsII/v22.2b14/compat/simuls/
dsII/v22.2b14/testsuite/
dsII/v22.2b14/testsuite/clone/
dsII/v22.2b14/testsuite/command/
dsII/v22.2b14/testsuite/data/
dsII/v22.2b14/testsuite/etc/
dsII/v22.2b14/testsuite/include/
dsII/v22.2b14/testsuite/inherit/
dsII/v22.2b14/testsuite/inherit/master/
dsII/v22.2b14/testsuite/log/
dsII/v22.2b14/testsuite/single/
dsII/v22.2b14/testsuite/single/tests/compiler/
dsII/v22.2b14/testsuite/single/tests/efuns/
dsII/v22.2b14/testsuite/single/tests/operators/
dsII/v22.2b14/testsuite/u/
dsII/v22.2b14/tmp/
dsII/win32/
void do_tests() {
    string src = "This is a test";

    for (int i = 0; i < 2; i++) {
	ASSERT(replace_string(src, "", "bar") == src);
	ASSERT(replace_string(src, "foo", "bar", 5, 4) == src);
    
	// case 1: rlen <= plen, plen > 1, rlen > 0
	ASSERT(replace_string(src, "is", "x") == "Thx x a test");
	ASSERT(replace_string(src, "is", "x", 1) == "Thx is a test");
	ASSERT(replace_string(src, "is", "x", 0, 0) == "Thx x a test");
	ASSERT(replace_string(src, "is", "x", 0, 1) == "Thx is a test");
	ASSERT(replace_string(src, "is", "x", 0, 2) == "Thx x a test");
	ASSERT(replace_string(src, "is", "x", 1, 1) == "Thx is a test");
	ASSERT(replace_string(src, "is", "x", 1, 2) == "Thx x a test");
	ASSERT(replace_string(src, "is", "x", 2, 2) == "This x a test");
	// case 2: rlen <= plen, plen > 1, rlen == 0
        ASSERT(replace_string(src, "is", "") == "Th  a test");
	ASSERT(replace_string(src, "is", "", 1) == "Th is a test");
	ASSERT(replace_string(src, "is", "", 0, 0) == "Th  a test");
	ASSERT(replace_string(src, "is", "", 0, 1) == "Th is a test");
	ASSERT(replace_string(src, "is", "", 0, 2) == "Th  a test");
	ASSERT(replace_string(src, "is", "", 1, 1) == "Th is a test");
	ASSERT(replace_string(src, "is", "", 1, 2) == "Th  a test");
	ASSERT(replace_string(src, "is", "", 2, 2) == "This  a test");
        // case 3: rlen <= plen, plen == 1, rlen > 0
	ASSERT(replace_string(src, "s", "x") == "Thix ix a text");
	ASSERT(replace_string(src, "s", "x", 1) == "Thix is a test");
	ASSERT(replace_string(src, "s", "x", 2) == "Thix ix a test");
	ASSERT(replace_string(src, "s", "x", 0, 0) == "Thix ix a text");
	ASSERT(replace_string(src, "s", "x", 0, 1) == "Thix is a test");
	ASSERT(replace_string(src, "s", "x", 0, 2) == "Thix ix a test");
	ASSERT(replace_string(src, "s", "x", 1, 1) == "Thix is a test");
	ASSERT(replace_string(src, "s", "x", 1, 2) == "Thix ix a test");
	ASSERT(replace_string(src, "s", "x", 1, 3) == "Thix ix a text");
	ASSERT(replace_string(src, "s", "x", 2, 2) == "This ix a test");
	// case 4: rlen <= plen, plen == 1, rlen == 0
	ASSERT(replace_string(src, "s", "") == "Thi i a tet");
	ASSERT(replace_string(src, "s", "", 1) == "Thi is a test");
	ASSERT(replace_string(src, "s", "", 2) == "Thi i a test");
	ASSERT(replace_string(src, "s", "", 0, 0) == "Thi i a tet");
	ASSERT(replace_string(src, "s", "", 0, 1) == "Thi is a test");
	ASSERT(replace_string(src, "s", "", 0, 2) == "Thi i a test");
	ASSERT(replace_string(src, "s", "", 1, 1) == "Thi is a test");
	ASSERT(replace_string(src, "s", "", 1, 2) == "Thi i a test");
	ASSERT(replace_string(src, "s", "", 1, 3) == "Thi i a tet");
	ASSERT(replace_string(src, "s", "", 2, 2) == "This i a test");
	// case 5: rlen > plen, plen > 1, rlen > 0
        ASSERT(replace_string(src, "is", "foo") == "Thfoo foo a test");
	ASSERT(replace_string(src, "is", "foo", 1) == "Thfoo is a test");
	ASSERT(replace_string(src, "is", "foo", 2) == "Thfoo foo a test");
	ASSERT(replace_string(src, "is", "foo", 0, 0) == "Thfoo foo a test");
	ASSERT(replace_string(src, "is", "foo", 0, 1) == "Thfoo is a test");
	ASSERT(replace_string(src, "is", "foo", 0, 2) == "Thfoo foo a test");
	ASSERT(replace_string(src, "is", "foo", 1, 1) == "Thfoo is a test");
	ASSERT(replace_string(src, "is", "foo", 1, 2) == "Thfoo foo a test");
	ASSERT(replace_string(src, "is", "foo", 1, 3) == "Thfoo foo a test");
	ASSERT(replace_string(src, "is", "foo", 2, 2) == "This foo a test");
	// case 6: rlen > plen, plen == 1
        ASSERT(replace_string(src, "s", "foo") == "Thifoo ifoo a tefoot");
	ASSERT(replace_string(src, "s", "foo", 1) == "Thifoo is a test");
	ASSERT(replace_string(src, "s", "foo", 2) == "Thifoo ifoo a test");
	ASSERT(replace_string(src, "s", "foo", 0, 0) == "Thifoo ifoo a tefoot");
	ASSERT(replace_string(src, "s", "foo", 0, 1) == "Thifoo is a test");
	ASSERT(replace_string(src, "s", "foo", 0, 2) == "Thifoo ifoo a test");
	ASSERT(replace_string(src, "s", "foo", 1, 1) == "Thifoo is a test");
	ASSERT(replace_string(src, "s", "foo", 1, 2) == "Thifoo ifoo a test");
	ASSERT(replace_string(src, "s", "foo", 1, 3) == "Thifoo ifoo a tefoot");
	ASSERT(replace_string(src, "s", "foo", 2, 2) == "This ifoo a test");

	src = src[0..5] + src[6..];
    }
}