[ZPT] CVS: Zope/lib/python/ZTUtils/tests - testTree.py:1.2

Martijn Pieters mj@zope.com
Fri, 4 Oct 2002 16:27:02 -0400


Update of /cvs-repository/Zope/lib/python/ZTUtils/tests
In directory cvs.zope.org:/tmp/cvs-serv13240/lib/python/ZTUtils/tests

Modified Files:
	testTree.py 
Log Message:
Add regression test for issue #603.


=== Zope/lib/python/ZTUtils/tests/testTree.py 1.1 => 1.2 ===
--- Zope/lib/python/ZTUtils/tests/testTree.py:1.1	Fri Oct  4 16:06:52 2002
+++ Zope/lib/python/ZTUtils/tests/testTree.py	Fri Oct  4 16:27:01 2002
@@ -176,6 +176,20 @@
         self.assertEqual(treeroot1.size, treeroot2.size)
         self.assertEqual(len(treeroot1), len(treeroot2))
 
+    def testEncodedExpansionIdWithDot(self):
+        # Regression test for Collector issue #603
+        # An encoded node ID with a first character with the first 6 bits set.
+        item = Item('\xfcberbug!', (Item('b'),)) # 'uberbug!' with u-umlaut.
+        treeroot1 = self.tm.tree(item)
+        
+        encoded = Tree.encodeExpansion(treeroot1.flat())
+        decodedmap = Tree.decodeExpansion(encoded)
+
+        treeroot2 = self.tm.tree(item, decodedmap)
+
+        self.assertEqual(treeroot1.size, treeroot2.size)
+        self.assertEqual(len(treeroot1), len(treeroot2))
+
 
 def test_suite():
     return unittest.makeSuite(TreeTests)