##// END OF EJS Templates
tests: use raw string in test-check-code.t...
Gregory Szorc -
r41688:f16c03c7 default
parent child Browse files
Show More
@@ -1,69 +1,69 b''
1 1 #require test-repo
2 2
3 3 $ . "$TESTDIR/helpers-testrepo.sh"
4 4 $ check_code="$TESTDIR"/../contrib/check-code.py
5 5 $ cd "$TESTDIR"/..
6 6
7 7 New errors are not allowed. Warnings are strongly discouraged.
8 8 (The writing "no-che?k-code" is for not skipping this file when checking.)
9 9
10 10 $ testrepohg locate \
11 11 > -X contrib/python-zstandard \
12 12 > -X hgext/fsmonitor/pywatchman \
13 13 > -X mercurial/thirdparty \
14 14 > | sed 's-\\-/-g' | "$check_code" --warnings --per-file=0 - || false
15 15 Skipping i18n/polib.py it has no-che?k-code (glob)
16 16 Skipping mercurial/statprof.py it has no-che?k-code (glob)
17 17 Skipping tests/badserverext.py it has no-che?k-code (glob)
18 18
19 19 @commands in debugcommands.py should be in alphabetical order.
20 20
21 21 >>> import re
22 22 >>> commands = []
23 23 >>> with open('mercurial/debugcommands.py', 'rb') as fh:
24 24 ... for line in fh:
25 ... m = re.match(b"^@command\('([a-z]+)", line)
25 ... m = re.match(br"^@command\('([a-z]+)", line)
26 26 ... if m:
27 27 ... commands.append(m.group(1))
28 28 >>> scommands = list(sorted(commands))
29 29 >>> for i, command in enumerate(scommands):
30 30 ... if command != commands[i]:
31 31 ... print('commands in debugcommands.py not sorted; first differing '
32 32 ... 'command is %s; expected %s' % (commands[i], command))
33 33 ... break
34 34
35 35 Prevent adding new files in the root directory accidentally.
36 36
37 37 $ testrepohg files 'glob:*'
38 38 .arcconfig
39 39 .clang-format
40 40 .editorconfig
41 41 .hgignore
42 42 .hgsigs
43 43 .hgtags
44 44 .jshintrc
45 45 CONTRIBUTING
46 46 CONTRIBUTORS
47 47 COPYING
48 48 Makefile
49 49 README.rst
50 50 hg
51 51 hgeditor
52 52 hgweb.cgi
53 53 setup.py
54 54
55 55 Prevent adding modules which could be shadowed by ancient .so/.dylib.
56 56
57 57 $ testrepohg files \
58 58 > mercurial/base85.py \
59 59 > mercurial/bdiff.py \
60 60 > mercurial/diffhelpers.py \
61 61 > mercurial/mpatch.py \
62 62 > mercurial/osutil.py \
63 63 > mercurial/parsers.py \
64 64 > mercurial/zstd.py
65 65 [1]
66 66
67 67 Keep python3 tests sorted:
68 68 $ sort < contrib/python3-whitelist > $TESTTMP/py3sorted
69 69 $ cmp contrib/python3-whitelist $TESTTMP/py3sorted || echo 'Please sort passing tests!'
General Comments 0
You need to be logged in to leave comments. Login now