[Pkg-bazaar-commits] ./bzr/unstable r935: - log weave for merge tests to help debugging

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:21:30 UTC 2009


------------------------------------------------------------
revno: 935
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Mon 2005-07-18 07:21:56 -0300
message:
  - log weave for merge tests to help debugging
  - remove test that depends too much on the implementation of delta
modified:
  tools/testweave.py
-------------- next part --------------
=== modified file 'tools/testweave.py'
--- a/tools/testweave.py	2005-07-17 17:53:39 +0000
+++ b/tools/testweave.py	2005-07-18 10:21:56 +0000
@@ -106,38 +106,6 @@
 
 
 
-class DeltaAdd(TestBase):
-    """Detection of changes prior to inserting new revision."""
-    def runTest(self):
-        k = Weave()
-        k.add([], ['line 1'])
-
-        self.assertEqual(k._l,
-                         [('{', 0),
-                          'line 1',
-                          ('}', 0),
-                          ])
-
-        changes = list(k._delta(IntSet([0]),
-                                ['line 1',
-                                 'new line']))
-
-        self.log('raw changes: ' + pformat(changes))
-
-        # currently there are 3 lines in the weave, and we insert after them
-        self.assertEquals(changes,
-                          [(3, 3, ['new line'])])
-
-        changes = k._delta(set([0]),
-                           ['top line',
-                            'line 1'])
-        
-        self.assertEquals(list(changes),
-                          [(1, 1, ['top line'])])
-
-        self.check_read_write(k)
-
-
 class InvalidAdd(TestBase):
     """Try to use invalid version number during add."""
     def runTest(self):
@@ -700,6 +668,11 @@
         w.add([0], map(addcrlf, a))
         w.add([0], map(addcrlf, b))
 
+        self.log('weave is:')
+        tmpf = StringIO()
+        write_weave(w, tmpf)
+        self.log(tmpf.getvalue())
+
         self.log('merge plan:')
         p = list(w.plan_merge(1, 2))
         for state, line in p:



More information about the Pkg-bazaar-commits mailing list