view tests/test-check-code @ 10722:c4fb2103e734

check-code: improve quote detection regexp, add tests
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 17 Mar 2010 14:15:33 +0100
parents 83dce0f817f4
children 62b8f15683f2
line wrap: on
line source

#!/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

cat > quote.py <<EOF
(''' ( 4x5 )
but """\''' and finally''',
"""let's fool checkpatch""", '1+2',
'"""', 42+1, """and
( 4-1 ) """, "( 1+1 )\" and ")
EOF

check_code=`dirname $0`/../contrib/check-code.py
${check_code} ./wrong.py ./correct.py ./quote.py