assert("size_t".findAcronymAt("sz_t", FindContext.inWord)[0] == "size_t"); assert("size_t".findAcronymAt("sz_t", FindContext.inSymbol)[0] == "size_t"); assert("åäö_ab".findAcronymAt("ab")[0] == "ab"); assert("fopen".findAcronymAt("fpn")[0] == "fopen"); assert("fopen_".findAcronymAt("fpn")[0] == "fopen"); assert("_fopen".findAcronymAt("fpn", FindContext.inWord)[0] == "fopen"); assert("_fopen".findAcronymAt("fpn", FindContext.inSymbol)[0] == "fopen"); assert("f_open".findAcronymAt("fpn", FindContext.inWord)[0] == []); assert("f_open".findAcronymAt("fpn", FindContext.inSymbol)[0] == "f_open");
Find needle as Word or Symbol Acronym at haystackOffset in haystack. TODO Make it compatible (specialized) for InputRange or BidirectionalRange.