]> git.phdru.name Git - mimedecode.git/blobdiff - test/test_all
Fixed last problems with Python 3
[mimedecode.git] / test / test_all
index 69eb614c0bc4bebb2085f71570c99d4b5f50b80f..d5b06e1923b9bc4b1148af56d94d3005bcd086c8 100755 (executable)
@@ -8,14 +8,22 @@ rm -rf save tmp &&
 mkdir tmp || exit 1
 
 RC=0
+if [ `$PYTHON -c "import sys; print(sys.version[0])"` -eq 2 ]; then
+   PY3=NO
+else
+   PY3=YES
+fi
 
 test1() {
    infile="$1"
    shift
    expfile="$1"
+   if [ $PY3 = YES -a -f expected/"$expfile"-py3 ]; then
+      expfile="$expfile"-py3
+   fi
    shift
 
-   ../mimedecode.py -H test -f utf-8 "$@" input/"$infile" >tmp/"$expfile" || return 1
+   $PYTHON ../mimedecode.py -H test -f utf-8 "$@" input/"$infile" >tmp/"$expfile" || return 1
    if cmp -s expected/"$expfile" tmp/"$expfile"; then
       rm tmp/"$expfile" && return 0 || return 1
    else