diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2005-11-22 19:04:36 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2005-11-22 19:04:36 (GMT) |
commit | 4af716958a93298b84606406936c20605e95a09f (patch) | |
tree | 3512b97502a5cc792c1a01148c1b67b950cbfaf1 /Lib/test | |
parent | 4e2a4ff6079db5e2115d8879fa511ecde161eae9 (diff) | |
download | cpython-4af716958a93298b84606406936c20605e95a09f.zip cpython-4af716958a93298b84606406936c20605e95a09f.tar.gz cpython-4af716958a93298b84606406936c20605e95a09f.tar.bz2 |
[Patch #1094164] replaceChild(x,x) ends up removing x from the tree. Add fix from Felix Rabe and a test case
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_minidom.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py index 8b4c715..68aac0f 100644 --- a/Lib/test/test_minidom.py +++ b/Lib/test/test_minidom.py @@ -1127,6 +1127,17 @@ def testWholeText(): checkWholeText(text, "cabd") checkWholeText(text2, "cabd") +def testPatch1094164 (): + doc = parseString("<doc><e/></doc>") + elem = doc.documentElement + e = elem.firstChild + confirm(e.parentNode is elem, "Before replaceChild()") + # Check that replacing a child with itself leaves the tree unchanged + elem.replaceChild(e, e) + confirm(e.parentNode is elem, "After replaceChild()") + + + def testReplaceWholeText(): def setup(): doc = parseString("<doc>a<e/>d</doc>") |