Fix chained compares with -'s

This commit is contained in:
rocky 2017-12-02 12:06:01 -05:00
parent 93949e8222
commit 5919be1451
7 changed files with 28 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -17,3 +17,6 @@ y ^= 1 # INPLACE_XOR
x = [1,2,3,4,5]
x[0:1] = 1
x[0:3] += 1, 2, 3
# Is not in chained compare
x[0] is not x[1] is not x[2]

View File

@ -7,7 +7,22 @@ PYVERSION=${FULLVERSION%.*}
MINOR=${FULLVERSION##?.?.}
typeset -i STOP_ONERROR=1
typeset -A SKIP_TESTS=( [test_aepack.py]=1 [audiotests.py]=1)
typeset -A SKIP_TESTS
case $PYVERSION in
2.6)
SKIP_TESTS=( [test_array.py]=1 [test_asyncore.py]=1)
;;
2.7)
SKIP_TESTS=(
[test_builtin.py]=1 [test_contextlib.py]=1
[test_decimal.py]=] [test_decorators.py]=1
)
;;
*)
SKIP_TESTS=( [test_aepack.py]=1 [audiotests.py]=1)
;;
esac
# Test directory setup
srcdir=$(dirname $me)
@ -25,7 +40,13 @@ export PYTHONPATH=$TESTDIR
# Run tests
typeset -i i=0
typeset -i allerrs=0
for file in test_*.py; do
if [[ -n $1 ]] ; then
files=$1
SKIP_TESTS=()
else
files=test_*.py
fi
for file in $files; do
[[ -v SKIP_TESTS[$file] ]] && continue
# If the fails *before* decompiling, skip it!

View File

@ -193,8 +193,8 @@ TABLE_DIRECT = {
'compare_single': ( '%p %[-1]{pattr.replace("-", " ")} %p', (0, 19), (1, 19) ),
'compare_chained': ( '%p %p', (0, 29), (1, 30)),
'compare_chained1': ( '%[3]{pattr} %p %p', (0, 19), (-2, 19)),
'compare_chained2': ( '%[1]{pattr} %p', (0, 19)),
'compare_chained1': ( '%[3]{pattr.replace("-", " ")} %p %p', (0, 19), (-2, 19)),
'compare_chained2': ( '%[1]{pattr.replace("-", " ")} %p', (0, 19)),
# 'classdef': (), # handled by n_classdef()
'function_def': ( '\n\n%|def %c\n', -2), # -2 to handle closures
'funcdefdeco': ( '\n\n%c', 0),