Rev 3797: It seems that map()'s split code fails when the new key is simply longer. in http://bzr.arbash-meinel.com/branches/bzr/brisbane/chk_map

John Arbash Meinel john at arbash-meinel.com
Tue Dec 2 19:01:06 GMT 2008


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

------------------------------------------------------------
revno: 3797
revision-id: john at arbash-meinel.com-20081202190056-1d7abe90mtf0kkag
parent: john at arbash-meinel.com-20081202185728-tt9nrap4t9fx97p2
committer: John Arbash Meinel <john at arbash-meinel.com>
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.
-------------- next part --------------
=== 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)



More information about the bazaar-commits mailing list