Btw, when code is too long what we usually do is introduce aliases in the unittest, for example:

```D
unittest
{
    debug(string) printf("string.indexOf(startIdx).unittest\n");

    dchar D(dchar c) { return c; }
    char C(char c) { return c; }
    alias CS = CaseSensitive;

    foreach (STR; TypeTuple!(string, wstring, dstring))
    {
        alias to!STR S;

        assert(indexOf(cast(STR)null, D('a'), 1) == -1);
        assert(indexOf(S("def"), D('a'), 1) == -1);
        assert(indexOf(S("abba"), D('a'), 1) == 3);
        assert(indexOf(S("def"), D('f'), 1) == 2);
        assert(indexOf(S("def"), D('a'), 1, CS.no) == -1);
        assert(indexOf(S("def"), D('a'), 1, CS.no) == -1);
        assert(indexOf(S("def"), D('a'), 12, CS.no) == -1);
        assert(indexOf(S("AbbA"), D('a'), 2, CS.no) == 3);
        assert(indexOf(S("def"), D('F'), 2, CS.no) == 2);

        STR sPlts = "Mars: the fourth Rock (Planet) from the Sun.";
        assert(indexOf("def", C('f'), cast(uint)2, CS.no) == 2);
        assert(indexOf(sPlts, C('P'), 12, CS.no) == 23);
        assert(indexOf(sPlts, C('R'), cast(ulong)1, CS.no) == 2);
    }

    foreach (cs; EnumMembers!CS)
    {
        assert(indexOf("hello\U00010143\u0100\U00010143", '\u0100', 2, cs) == 9);
        assert(indexOf("hello\U00010143\u0100\U00010143"w, '\u0100', 3, cs) == 7);
        assert(indexOf("hello\U00010143\u0100\U00010143"d, '\u0100', 6, cs) == 6);
    }
}
```