svoid test_LCSingleSearcher_v1_systematically(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); for (int j = 1; j <= n+(checkOverlongQueries ? 1 : 0); j++) for (S query : allABCCombinationsOfLength(j)) { ++tests; Pair, S> output = hijackPrintWithResult(() -> { new LCSingleSearcher_v1 searcher; searcher.text = text; ret searcher.search(query); }); L correct = indicesOf(text, query); L out = sorted(output.a); if (eq(correct, out)) { if (verbose) print("OK " + query + " in " + text + ": " + out); } else { print(output); fail(query + " in " + text + ": " + out + " / " + correct); } } } print(nTests(tests) + " done"); } }