At http://bzr.arbash-meinel.com/branches/bzr/brisbane/chk_map

------------------------------------------------------------
revno: 3797
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: John Arbash Meinel <[EMAIL PROTECTED]>
branch nick: chk_map
timestamp: Tue 2008-12-02 13:00:56 -0600
message:
  It seems that map()'s split code fails when the new key is simply longer.
  
  Add a failing test so I don't forget to come back and fix it.
=== modified file 'bzrlib/tests/test_chk_map.py'
--- a/bzrlib/tests/test_chk_map.py      2008-12-02 18:57:28 +0000
+++ b/bzrlib/tests/test_chk_map.py      2008-12-02 19:00:56 +0000
@@ -242,6 +242,16 @@
                              chkmap._dump_tree())
         self.assertCanonicalForm(chkmap)
 
+    def test_map_splits_with_longer_key(self):
+        store = self.get_chk_bytes()
+        chkmap = CHKMap(store, None)
+        # Should fit 1 key per LeafNode
+        chkmap._root_node.set_maximum_size(10)
+        chkmap.map(('aaa',), 'v')
+        chkmap.map(('aaaa',), 'v')
+        self.assertCanonicalForm(chkmap)
+        self.assertIsInstance(chkmap._root_node, InternalNode)
+
     def test_deep_splitting(self):
         store = self.get_chk_bytes()
         chkmap = CHKMap(store, None)

-- 
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits

Reply via email to