svoid testSuffixTreeSystematically(int max, O... _) { optPar bool verbose; optPar bool checkOverlongQueries = true; for (int n = 0; n <= max; n++) { print("Testing length " + n); int tests = 0; for (S text : allABCCombinationsOfLength(n)) { //print(+text); SuffixTree tree = new(text); if (l(text) <= 4) tree.printMe(); for (int j = 1; j <= n+(checkOverlongQueries ? 1 : 0); j++) for (S query : allABCCombinationsOfLength(j)) { ++tests; L correct = indicesOf(text, query); L out = sorted(tree.indicesOf(query)); if (eq(correct, out)) { if (verbose) print("OK " + query + " in " + text + ": " + out); } else { fail(query + " in " + text + ": " + out + " / " + correct); } } } print(nTests(tests) + " done"); } }