Mercurial > public > mercurial-scm > hg-stable
diff tests/test-minifileset.py @ 43076:2372284d9457
formatting: blacken the codebase
This is using my patch to black
(https://github.com/psf/black/pull/826) so we don't un-wrap collection
literals.
Done with:
hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S
# skip-blame mass-reformatting only
# no-check-commit reformats foo_bar functions
Differential Revision: https://phab.mercurial-scm.org/D6971
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 06 Oct 2019 09:45:02 -0400 |
parents | 8a08aefa9273 |
children | 6000f5b25c9b |
line wrap: on
line diff
--- a/tests/test-minifileset.py Sat Oct 05 10:29:34 2019 -0400 +++ b/tests/test-minifileset.py Sun Oct 06 09:45:02 2019 -0400 @@ -3,6 +3,7 @@ from mercurial import minifileset + def check(text, truecases, falsecases): f = minifileset.compile(text) for args in truecases: @@ -12,24 +13,31 @@ if f(*args): print('unexpected: %r should exclude %r' % (text, args)) + check(b'all()', [(b'a.php', 123), (b'b.txt', 0)], []) check(b'none()', [], [(b'a.php', 123), (b'b.txt', 0)]) check(b'!!!!((!(!!all())))', [], [(b'a.php', 123), (b'b.txt', 0)]) -check(b'"path:a" & (**.b | **.c)', - [(b'a/b.b', 0), (b'a/c.c', 0)], [(b'b/c.c', 0)]) -check(b'(path:a & **.b) | **.c', - [(b'a/b.b', 0), (b'a/c.c', 0), (b'b/c.c', 0)], []) +check( + b'"path:a" & (**.b | **.c)', [(b'a/b.b', 0), (b'a/c.c', 0)], [(b'b/c.c', 0)] +) +check( + b'(path:a & **.b) | **.c', [(b'a/b.b', 0), (b'a/c.c', 0), (b'b/c.c', 0)], [] +) -check(b'**.bin - size("<20B")', - [(b'b.bin', 21)], [(b'a.bin', 11), (b'b.txt', 21)]) +check( + b'**.bin - size("<20B")', [(b'b.bin', 21)], [(b'a.bin', 11), (b'b.txt', 21)] +) -check(b'!!**.bin or size(">20B") + "path:bin" or !size(">10")', - [(b'a.bin', 11), (b'b.txt', 21), (b'bin/abc', 11)], - [(b'a.notbin', 11), (b'b.txt', 11), (b'bin2/abc', 11)]) +check( + b'!!**.bin or size(">20B") + "path:bin" or !size(">10")', + [(b'a.bin', 11), (b'b.txt', 21), (b'bin/abc', 11)], + [(b'a.notbin', 11), (b'b.txt', 11), (b'bin2/abc', 11)], +) check( b'(**.php and size(">10KB")) | **.zip | ("path:bin" & !"path:bin/README") ' b' | size(">1M")', [(b'a.php', 15000), (b'a.zip', 0), (b'bin/a', 0), (b'bin/README', 1e7)], - [(b'a.php', 5000), (b'b.zip2', 0), (b't/bin/a', 0), (b'bin/README', 1)]) + [(b'a.php', 5000), (b'b.zip2', 0), (b't/bin/a', 0), (b'bin/README', 1)], +)