From: Georg Brandl Date: Thu, 25 Aug 2005 22:14:15 +0000 (+0000) Subject: bug [ 1262320 ] minidom.py alternate newl support is broken X-Git-Tag: v2.5a0~1449 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=905a01aba41988cb0c3d9fe15de38c3c94cc09dc;p=python bug [ 1262320 ] minidom.py alternate newl support is broken --- diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py index 15581ccfd2..3154fbf3e6 100644 --- a/Lib/test/test_minidom.py +++ b/Lib/test/test_minidom.py @@ -413,12 +413,19 @@ def testAttributeRepr(): def testTextNodeRepr(): pass def testWriteXML(): - str = '\n' + str = '' dom = parseString(str) domstr = dom.toxml() dom.unlink() confirm(str == domstr) +def testAltNewline(): + str = '\n\n' + dom = parseString(str) + domstr = dom.toprettyxml(newl="\r\n") + dom.unlink() + confirm(domstr == str.replace("\n", "\r\n")) + def testProcessingInstruction(): dom = parseString('') pi = dom.documentElement.firstChild @@ -878,9 +885,9 @@ def testSAX2DOM(): def testEncodings(): doc = parseString('') - confirm(doc.toxml() == u'\n\u20ac' - and doc.toxml('utf-8') == '\n\xe2\x82\xac' - and doc.toxml('iso-8859-15') == '\n\xa4', + confirm(doc.toxml() == u'\u20ac' + and doc.toxml('utf-8') == '\xe2\x82\xac' + and doc.toxml('iso-8859-15') == '\xa4', "testEncodings - encoding EURO SIGN") doc.unlink()