@Test public void testTestResultWithCommentDiagnostics() { final String tap = "1..2\n" + "ok 1 - OK\n" + "# No errors found\n" + "not ok 2\n" + "# Invalid stream character\n" + "# Missing end transmission signal\n" + "# Aborting mission!\n" + "ok"; final TestSet testSet = getConsumer().load(tap); assertEquals("No errors found", testSet.getTestResult(1).getComments().get(0).getText()); final String expected = "Invalid stream character\n" + "Missing end transmission signal\n" + "Aborting mission!\n"; final StringBuilder actualCommentText = new StringBuilder(); final TestResult testResult = testSet.getTestResult(2); final List<Comment> comments = testResult.getComments(); for (Comment comment : comments) { actualCommentText.append(comment.getText()); actualCommentText.append("\n"); } assertEquals(expected, actualCommentText.toString()); }