Rev 2618: Test digit buffering is accurate. in http://people.ubuntu.com/~robertc/baz2.0/repository

Robert Collins robertc at robertcollins.net
Fri Jul 13 10:21:14 BST 2007


At http://people.ubuntu.com/~robertc/baz2.0/repository

------------------------------------------------------------
revno: 2618
revision-id: robertc at robertcollins.net-20070713092112-n7b71oko7t9pn0am
parent: robertc at robertcollins.net-20070713090317-lq1j1c49ga2lha0o
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Fri 2007-07-13 19:21:12 +1000
message:
  Test digit buffering is accurate.
modified:
  bzrlib/tests/test_index.py     test_index.py-20070712131115-lolkarso50vjr64s-2
=== modified file 'bzrlib/tests/test_index.py'
--- a/bzrlib/tests/test_index.py	2007-07-13 09:03:17 +0000
+++ b/bzrlib/tests/test_index.py	2007-07-13 09:21:12 +0000
@@ -138,6 +138,26 @@
             "key\0\x0053\r38\0data\n"
             "\n", contents)
 
+    def test_node_references_three_digits(self):
+        # test the node digit expands as needed.
+        builder = GraphIndexBuilder(reference_lists=1)
+        references = map(str, range(9))
+        builder.add_node('5-key', (references, ), '')
+        stream = builder.finish()
+        contents = stream.read()
+        self.assertEqual("Bazaar Graph Index 1\nnode_ref_lists=1\n"
+            "8\x00a\x00\x00\n"
+            "7\x00a\x00\x00\n"
+            "6\x00a\x00\x00\n"
+            "5-key\x00\x00130\r124\r118\r112\r106\r100\r050\r044\r038\x00\n"
+            "5\x00a\x00\x00\n"
+            "4\x00a\x00\x00\n"
+            "3\x00a\x00\x00\n"
+            "2\x00a\x00\x00\n"
+            "1\x00a\x00\x00\n"
+            "0\x00a\x00\x00\n"
+            "\n", contents)
+
     def test_add_node_bad_key(self):
         builder = GraphIndexBuilder()
         for bad_char in '\t\n\x0b\x0c\r\x00 ':




More information about the bazaar-commits mailing list