##// END OF EJS Templates
tests: unify test-check-code
Brodie Rao -
r12632:6c98107f default
parent child Browse files
Show More
@@ -1,39 +1,54 b''
1 #!/bin/sh
1 $ cat > correct.py <<EOF
2 #cd `dirname $0`
2 > def toto(arg1, arg2):
3 cat > correct.py <<EOF
3 > del arg2
4 def toto(arg1, arg2):
4 > return (5 + 6, 9)
5 del arg2
5 > EOF
6 return (5 + 6, 9)
6 $ cat > wrong.py <<EOF
7 EOF
7 > def toto( arg1, arg2):
8
8 > del(arg2)
9 cat > wrong.py <<EOF
9 > return ( 5+6, 9)
10 def toto( arg1, arg2):
10 > EOF
11 del(arg2)
11 $ cat > quote.py <<EOF
12 return ( 5+6, 9)
12 > # let's use quote in comments
13 EOF
13 > (''' ( 4x5 )
14
14 > but """\\''' and finally''',
15 cat > quote.py <<EOF
15 > """let's fool checkpatch""", '1+2',
16 # let's use quote in comments
16 > '"""', 42+1, """and
17 (''' ( 4x5 )
17 > ( 4-1 ) """, "( 1+1 )\" and ")
18 but """\\''' and finally''',
18 > a, '\\\\\\\\', "\\\\\\" x-2", "c-1"
19 """let's fool checkpatch""", '1+2',
19 > EOF
20 '"""', 42+1, """and
20 $ cat > non-py24.py <<EOF
21 ( 4-1 ) """, "( 1+1 )\" and ")
21 > # Using builtins that does not exist in Python 2.4
22 a, '\\\\\\\\', "\\\\\\" x-2", "c-1"
22 > if any():
23 EOF
23 > x = all()
24
24 > y = format(x)
25 cat > non-py24.py <<EOF
25 >
26 # Using builtins that does not exist in Python 2.4
26 > # Do not complain about our own definition
27 if any():
27 > def any(x):
28 x = all()
28 > pass
29 y = format(x)
29 > EOF
30
30 $ check_code="$TESTDIR"/../contrib/check-code.py
31 # Do not complain about our own definition
31 $ "$check_code" ./wrong.py ./correct.py ./quote.py ./non-py24.py
32 def any(x):
32 ./wrong.py:1:
33 pass
33 > def toto( arg1, arg2):
34 EOF
34 gratuitous whitespace in () or []
35
35 ./wrong.py:2:
36 check_code=`dirname $0`/../contrib/check-code.py
36 > del(arg2)
37 ${check_code} ./wrong.py ./correct.py ./quote.py ./non-py24.py
37 del isn't a function
38
38 ./wrong.py:3:
39 exit 0
39 > return ( 5+6, 9)
40 missing whitespace in expression
41 gratuitous whitespace in () or []
42 ./quote.py:5:
43 > '"""', 42+1, """and
44 missing whitespace in expression
45 ./non-py24.py:2:
46 > if any():
47 any/all/format not available in Python 2.4
48 ./non-py24.py:3:
49 > x = all()
50 any/all/format not available in Python 2.4
51 ./non-py24.py:4:
52 > y = format(x)
53 any/all/format not available in Python 2.4
54 [1]
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now