~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to testknit.py

  • Committer: Martin Pool
  • Date: 2005-06-27 07:43:45 UTC
  • mto: This revision was merged to the branch mainline in revision 852.
  • Revision ID: mbp@sourcefrog.net-20050627074345-cd8511473b61c279
Calculate delta for new versions relative to a set of parent versions.

Simple test for delta calculation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
        k = Knit()
79
79
        k.add(['line 1'])
80
80
 
81
 
        changes = k._delta(set([0]),
82
 
                           ['line 1',
83
 
                            'new line'])
 
81
        changes = list(k._delta(set([0]),
 
82
                                ['line 1',
 
83
                                 'new line']))
84
84
 
85
85
        self.log('raw changes: ' + pformat(changes))
86
86
 
 
87
        # should be one inserted line after line 0
 
88
        self.assertEquals(changes,
 
89
                          [(1, 1, ['new line'])])
 
90
 
87
91
 
88
92
class MatchedLine(TestBase):
89
93
    """Store a revision that adds one line to the original.