Issue #1390: Raise ValueError in toxml when an invalid comment would
otherwise be produced.
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index 97bca2c..f1f1378 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -1314,6 +1314,11 @@
             for i in range(len(n1.childNodes)):
                 stack.append((n1.childNodes[i], n2.childNodes[i]))
 
+    def testSerializeCommentNodeWithDoubleHyphen(self):
+        doc = create_doc_without_doctype()
+        doc.appendChild(doc.createComment("foo--bar"))
+        self.assertRaises(ValueError, doc.toxml)
+
 def test_main():
     run_unittest(MinidomTest)