~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_patches.py

  • Committer: Benoît Pierre
  • Date: 2008-11-30 15:15:29 UTC
  • mto: (4056.1.1 trunk2)
  • mto: This revision was merged to the branch mainline in revision 4058.
  • Revision ID: benoit.pierre@gmail.com-20081130151529-o89ms591a079s026
Add patches test for 'No newline at end of file' in the middle of hunk lines.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
                            iter_patched_from_hunks,
35
35
                            parse_line,
36
36
                            parse_patch,
37
 
                            parse_patches)
 
37
                            parse_patches,
 
38
                            NO_NL)
38
39
 
39
40
 
40
41
class PatchesTester(TestCase):
112
113
        self.lineThing(" hello\n", ContextLine)
113
114
        self.lineThing("+hello\n", InsertLine)
114
115
        self.lineThing("-hello\n", RemoveLine)
115
 
    
 
116
 
116
117
    def testMalformedLine(self):
117
118
        """Parse invalid valid hunk lines"""
118
119
        self.makeMalformedLine("hello\n")
119
 
    
 
120
 
 
121
    def testMalformedLineNO_NL(self):
 
122
        """Parse invalid 'No newline at end of file' in hunk lines"""
 
123
        self.makeMalformedLine(NO_NL)
 
124
 
120
125
    def compare_parsed(self, patchtext):
121
126
        lines = patchtext.splitlines(True)
122
127
        patch = parse_patch(lines.__iter__())