public void testCheckForBadComments() { String s = "abc <!-- comment <!-- def --> <!-- ghi --> jkl"; String t = "abc <!-- comment --><!-- def --> <!-- ghi --> jkl"; String ns = NRC_HTMLDocumentByCobra.checkForBadComments(s); assertTrue("Wrong: " + StringUtils.difference(t, ns), ns.equals(t)); s = "abc <!-- comment --><!-- def --> <!-- ghi --> jkl"; t = "abc <!-- comment --><!-- def --> <!-- ghi --> jkl"; ns = NRC_HTMLDocumentByCobra.checkForBadComments(s); s = "abc <!-- comment --><!-- def --> <!-- ghi jkl"; t = "abc <!-- comment --><!-- def --> <!-- ghi jkl-->"; ns = NRC_HTMLDocumentByCobra.checkForBadComments(s); s = "abc <!-- comment --><!-- def <!-- ghi --> jkl"; t = "abc <!-- comment --><!-- def --><!-- ghi --> jkl"; ns = NRC_HTMLDocumentByCobra.checkForBadComments(s); }