!752 static L poem; // reference poem p { L texts = loadPoems("#1003064"); // Simple Poem poem = parsePoem(texts.get(0).lines); printStructure(poem); L test = parsePoem(texts.get(1).lines); printStructure(test); L failingTest = parsePoem(texts.get(2).lines); printStructure("Failing test: ", failingTest); S input = "q: are you on? "; L inp = parsePoem(input); printStructure("Input: ", inp); printStructure("Prediction: ", predict(inp)); print("Test: " + assertTrue(runPoemTest1(test))); print("Failing test: " + assertFalse(runPoemTest1(failingTest))); print("OK!"); } // used by runPoemTest1 static L predict(L input) { int n = l(input); if (l(poem) < n) ret null; // poem too short for (int i = 0; i < n; i++) { E x = poem.get(i), y = input.get(i); if (!x.eqTo(y)) ret null; } ret subList(poem, n); }