示例#1
0
 def testBasicReplace(self):
     a = ["a", "b"]
     b = ["a", "c"]
     self.assertDiff(a, b, [new_chunk(tag='equal', lines=[new_line(0, 0)]),
                            new_chunk(tag='replace', lines=[new_line(1, 1)])])
示例#2
0
 def testBasicDelete(self):
     a = ["a", "b"]
     b = ["a"]
     self.assertDiff(a, b, [new_chunk(tag='equal', lines=[new_line(0, 0)]),
                            new_chunk(tag='delete', lines=[new_line(1, None)])])
示例#3
0
 def testFakeInserted(self):
     a = None
     b = ["a"]
     self.assertDiff(a, b, [new_chunk(tag='insert', lines=[new_line(0, 0)])])
示例#4
0
 def testBasicInsert(self):
     a = ["a"]
     b = ["a", "b"]
     self.assertDiff(a, b, [new_chunk(tag='equal', lines=[new_line(0, 0)]),
                            new_chunk(tag='insert', lines=[new_line(None, 1)])])
示例#5
0
 def testFakeDeleted(self):
     a = ["a"]
     b = None
     self.assertDiff(a, b, [new_chunk(tag='delete', lines=[new_line(0, 0)])])