test-check-code
39 lines
| 724 B
| text/plain
|
TextLexer
/ tests / test-check-code
Pierre-Yves David
|
r10715 | #!/bin/sh | ||
#cd `dirname $0` | ||||
cat > correct.py <<EOF | ||||
def toto(arg1, arg2): | ||||
del arg2 | ||||
return (5 + 6, 9) | ||||
EOF | ||||
cat > wrong.py <<EOF | ||||
def toto( arg1, arg2): | ||||
del(arg2) | ||||
return ( 5+6, 9) | ||||
EOF | ||||
Benoit Boissinot
|
r10722 | cat > quote.py <<EOF | ||
Benoit Boissinot
|
r10727 | # let's use quote in comments | ||
Benoit Boissinot
|
r10722 | (''' ( 4x5 ) | ||
Benoit Boissinot
|
r10727 | but """\\''' and finally''', | ||
Benoit Boissinot
|
r10722 | """let's fool checkpatch""", '1+2', | ||
'"""', 42+1, """and | ||||
( 4-1 ) """, "( 1+1 )\" and ") | ||||
Benoit Boissinot
|
r10727 | a, '\\\\\\\\', "\\\\\\" x-2", "c-1" | ||
Benoit Boissinot
|
r10722 | EOF | ||
Martin Geisler
|
r11341 | cat > non-py24.py <<EOF | ||
# Using builtins that does not exist in Python 2.4 | ||||
if any(): | ||||
x = all() | ||||
Martin Geisler
|
r11343 | y = format(x) | ||
Martin Geisler
|
r11341 | |||
# Do not complain about our own definition | ||||
def any(x): | ||||
pass | ||||
EOF | ||||
Pierre-Yves David
|
r10715 | check_code=`dirname $0`/../contrib/check-code.py | ||
Martin Geisler
|
r11341 | ${check_code} ./wrong.py ./correct.py ./quote.py ./non-py24.py | ||
Martin Geisler
|
r11822 | |||
exit 0 | ||||