##// END OF EJS Templates
tests: start a set of unit tests for mdiff.py, starting with splitnewlines...
Augie Fackler -
r35880:1ab7b16c default
parent child Browse files
Show More
@@ -0,0 +1,24 b''
1 from __future__ import absolute_import
2 from __future__ import print_function
3
4 import unittest
5
6 from mercurial import (
7 mdiff,
8 )
9
10 class splitnewlinesTests(unittest.TestCase):
11
12 def test_splitnewlines(self):
13 cases = {'a\nb\nc\n': ['a\n', 'b\n', 'c\n'],
14 'a\nb\nc': ['a\n', 'b\n', 'c'],
15 'a\nb\nc\n\n': ['a\n', 'b\n', 'c\n', '\n'],
16 '': [],
17 'abcabc': ['abcabc'],
18 }
19 for inp, want in cases.iteritems():
20 self.assertEqual(mdiff.splitnewlines(inp), want)
21
22 if __name__ == '__main__':
23 import silenttestrunner
24 silenttestrunner.main(__name__)
General Comments 0
You need to be logged in to leave comments. Login now