Mercurial > hg
annotate tests/test-mdiff.py @ 37845:b4b7427b5786
tests: remove #require killdaemons
The killdaemons hghave feature has returned True since it was
introduced in 448d0c452140. As such, "#require killdaemons" has
no effect and is superfluous. So we remove instances of it.
Differential Revision: https://phab.mercurial-scm.org/D3442
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 30 Apr 2018 19:54:55 -0700 |
parents | 8d0b0b533e09 |
children | 2372284d9457 |
rev | line source |
---|---|
35862
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
1 from __future__ import absolute_import |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
2 from __future__ import print_function |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
3 |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
4 import unittest |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
5 |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
6 from mercurial import ( |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
7 mdiff, |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
8 ) |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
9 |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
10 class splitnewlinesTests(unittest.TestCase): |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
11 |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
12 def test_splitnewlines(self): |
36328
8d0b0b533e09
py3: add b'' prefixes in test-mdiff.py
Pulkit Goyal <7895pulkit@gmail.com>
parents:
36327
diff
changeset
|
13 cases = {b'a\nb\nc\n': [b'a\n', b'b\n', b'c\n'], |
8d0b0b533e09
py3: add b'' prefixes in test-mdiff.py
Pulkit Goyal <7895pulkit@gmail.com>
parents:
36327
diff
changeset
|
14 b'a\nb\nc': [b'a\n', b'b\n', b'c'], |
8d0b0b533e09
py3: add b'' prefixes in test-mdiff.py
Pulkit Goyal <7895pulkit@gmail.com>
parents:
36327
diff
changeset
|
15 b'a\nb\nc\n\n': [b'a\n', b'b\n', b'c\n', b'\n'], |
8d0b0b533e09
py3: add b'' prefixes in test-mdiff.py
Pulkit Goyal <7895pulkit@gmail.com>
parents:
36327
diff
changeset
|
16 b'': [], |
8d0b0b533e09
py3: add b'' prefixes in test-mdiff.py
Pulkit Goyal <7895pulkit@gmail.com>
parents:
36327
diff
changeset
|
17 b'abcabc': [b'abcabc'], |
35862
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
18 } |
36327
58c1368ab629
py3: use dict.items() instead of dict.iteritems() in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
35862
diff
changeset
|
19 for inp, want in cases.items(): |
35862
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
20 self.assertEqual(mdiff.splitnewlines(inp), want) |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
21 |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
22 if __name__ == '__main__': |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
23 import silenttestrunner |
1ab7b16c9437
tests: start a set of unit tests for mdiff.py, starting with splitnewlines
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
24 silenttestrunner.main(__name__) |