comparison tests/test_push_eol.py @ 96:9b5e528f67f8

Add a test to check EOLs are correctly converted
author Patrick Mezard <pmezard@gmail.com>
date Thu, 20 Nov 2008 22:41:16 -0600
parents
children c2d606a1dc6f
comparison
equal deleted inserted replaced
95:10dd34deac3b 96:9b5e528f67f8
1 import unittest
2
3 import test_util
4
5 class TestPushEol(test_util.TestBase):
6 def setUp(self):
7 test_util.TestBase.setUp(self)
8 test_util.load_fixture_and_fetch('emptyrepo.svndump',
9 self.repo_path,
10 self.wc_path)
11
12 def _test_push_dirs(self, stupid):
13 changes = [
14 # Root files with LF, CRLF and mixed EOL
15 ('lf', 'lf', 'a\nb\n\nc'),
16 ('crlf', 'crlf', 'a\r\nb\r\n\r\nc'),
17 ('mixed', 'mixed', 'a\r\nb\n\r\nc\nd'),
18 ]
19 self.commitchanges(changes)
20 self.pushrevisions(stupid)
21 self.assertchanges(changes, self.repo['tip'])
22
23 changes = [
24 # Update all files once, with same EOL
25 ('lf', 'lf', 'a\nb\n\nc\na\nb\n\nc'),
26 ('crlf', 'crlf', 'a\r\nb\r\n\r\nc\r\na\r\nb\r\n\r\nc'),
27 ('mixed', 'mixed', 'a\r\nb\n\r\nc\nd\r\na\r\nb\n\r\nc\nd'),
28 ]
29 self.commitchanges(changes)
30 self.pushrevisions(stupid)
31 self.assertchanges(changes, self.repo['tip'])
32
33 def test_push_dirs(self):
34 self._test_push_dirs(False)
35
36 def test_push_dirs_stupid(self):
37 self._test_push_dirs(True)
38
39 def suite():
40 all = [unittest.TestLoader().loadTestsFromTestCase(TestPushEol),
41 ]
42 return unittest.TestSuite(all)