Mercurial > hg
annotate tests/test-hg-parseurl.py @ 38047:dabc2237963c
crecord: fallback to text mode if diffs are too big for curses mode
crecord uses curses.newpad to create a region that we can then scroll around in
by moving the main 'screen' as a veiwport into the (probably larger than the
actual screen) pad. Internally, at least in ncurses, pads are implemented using
windows, which have their dimensions limited to a certain size. Depending on
compilation options for ncurses, this size might be pretty small: (signed)
short, or it might be larger ((signed) int).
crecord wants to have enough room to have all of the contents of the main area
of the chunkselector in the pad; this means that the full size with everything
expanded must be less than these (undocumented, afaict) limits.
It's not easy to write tests for this because the limits are platform- and
installation- dependent and undocumented / unqueryable, as far as I can tell.
Differential Revision: https://phab.mercurial-scm.org/D3577
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Thu, 17 May 2018 23:11:24 -0700 |
parents | 5dd71e9ae68a |
children | 2372284d9457 |
rev | line source |
---|---|
28746
de5808c57f58
py3: use print_function in test-hg-parseurl.py
Robert Stanca <robert.stanca7@gmail.com>
parents:
28745
diff
changeset
|
1 from __future__ import absolute_import, print_function |
28806
d26c4af27978
test-hg-parseurl: stop direct symbol import of mercurial.hg.parseurl
Yuya Nishihara <yuya@tcha.org>
parents:
28746
diff
changeset
|
2 |
37713
11d128a14ec0
tests: port test-hg-parseurl.py to unittest
Augie Fackler <augie@google.com>
parents:
28806
diff
changeset
|
3 import unittest |
11d128a14ec0
tests: port test-hg-parseurl.py to unittest
Augie Fackler <augie@google.com>
parents:
28806
diff
changeset
|
4 |
28806
d26c4af27978
test-hg-parseurl: stop direct symbol import of mercurial.hg.parseurl
Yuya Nishihara <yuya@tcha.org>
parents:
28746
diff
changeset
|
5 from mercurial import ( |
d26c4af27978
test-hg-parseurl: stop direct symbol import of mercurial.hg.parseurl
Yuya Nishihara <yuya@tcha.org>
parents:
28746
diff
changeset
|
6 hg, |
28745
8a23f88131c3
py3: use absolute_import in test-hg-parseurl.py
Robert Stanca <robert.stanca7@gmail.com>
parents:
13897
diff
changeset
|
7 ) |
8174
29bc5d18714a
hg: allow hg.parseurl(url, None)
Martijn Pieters <mj@zopatista.com>
parents:
diff
changeset
|
8 |
37713
11d128a14ec0
tests: port test-hg-parseurl.py to unittest
Augie Fackler <augie@google.com>
parents:
28806
diff
changeset
|
9 class ParseRequestTests(unittest.TestCase): |
11d128a14ec0
tests: port test-hg-parseurl.py to unittest
Augie Fackler <augie@google.com>
parents:
28806
diff
changeset
|
10 def testparse(self): |
8174
29bc5d18714a
hg: allow hg.parseurl(url, None)
Martijn Pieters <mj@zopatista.com>
parents:
diff
changeset
|
11 |
37714
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
12 self.assertEqual(hg.parseurl(b'http://example.com/no/anchor'), |
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
13 (b'http://example.com/no/anchor', (None, []))) |
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
14 self.assertEqual(hg.parseurl(b'http://example.com/an/anchor#foo'), |
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
15 (b'http://example.com/an/anchor', (b'foo', []))) |
37713
11d128a14ec0
tests: port test-hg-parseurl.py to unittest
Augie Fackler <augie@google.com>
parents:
28806
diff
changeset
|
16 self.assertEqual( |
37714
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
17 hg.parseurl(b'http://example.com/no/anchor/branches', [b'foo']), |
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
18 (b'http://example.com/no/anchor/branches', (None, [b'foo']))) |
37713
11d128a14ec0
tests: port test-hg-parseurl.py to unittest
Augie Fackler <augie@google.com>
parents:
28806
diff
changeset
|
19 self.assertEqual( |
37714
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
20 hg.parseurl(b'http://example.com/an/anchor/branches#bar', [b'foo']), |
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
21 (b'http://example.com/an/anchor/branches', (b'bar', [b'foo']))) |
37713
11d128a14ec0
tests: port test-hg-parseurl.py to unittest
Augie Fackler <augie@google.com>
parents:
28806
diff
changeset
|
22 self.assertEqual(hg.parseurl( |
37714
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
23 b'http://example.com/an/anchor/branches-None#foo', None), |
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
24 (b'http://example.com/an/anchor/branches-None', (b'foo', []))) |
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
25 self.assertEqual(hg.parseurl(b'http://example.com/'), |
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
26 (b'http://example.com/', (None, []))) |
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
27 self.assertEqual(hg.parseurl(b'http://example.com'), |
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
28 (b'http://example.com/', (None, []))) |
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
29 self.assertEqual(hg.parseurl(b'http://example.com#foo'), |
5dd71e9ae68a
tests: add b prefixes to test-hg-parseurl.py
Augie Fackler <augie@google.com>
parents:
37713
diff
changeset
|
30 (b'http://example.com/', (b'foo', []))) |
37713
11d128a14ec0
tests: port test-hg-parseurl.py to unittest
Augie Fackler <augie@google.com>
parents:
28806
diff
changeset
|
31 |
11d128a14ec0
tests: port test-hg-parseurl.py to unittest
Augie Fackler <augie@google.com>
parents:
28806
diff
changeset
|
32 if __name__ == '__main__': |
11d128a14ec0
tests: port test-hg-parseurl.py to unittest
Augie Fackler <augie@google.com>
parents:
28806
diff
changeset
|
33 import silenttestrunner |
11d128a14ec0
tests: port test-hg-parseurl.py to unittest
Augie Fackler <augie@google.com>
parents:
28806
diff
changeset
|
34 silenttestrunner.main(__name__) |