mgorny      14/07/06 17:13:14

  Modified:             python-utils-r1.sh
  Log:
  Add tests for _python_impl_supported.

Revision  Changes    Path
1.8                  eclass/tests/python-utils-r1.sh

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.8&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?rev=1.8&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/python-utils-r1.sh?r1=1.7&r2=1.8

Index: python-utils-r1.sh
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/tests/python-utils-r1.sh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- python-utils-r1.sh  19 Jun 2014 08:08:10 -0000      1.7
+++ python-utils-r1.sh  6 Jul 2014 17:13:14 -0000       1.8
@@ -19,10 +19,9 @@
 
 test_is() {
        local func=${1}
-       local EPYTHON=${2}
-       local expect=${3}
+       local expect=${2}
 
-       tbegin "${func} for ${EPYTHON} (expecting: ${3})"
+       tbegin "${func} (expecting: ${expect})"
 
        ${func}
        [[ ${?} == ${expect} ]]
@@ -88,10 +87,10 @@
 test_var PYTHON_PKG_DEP pypy '*virtual/pypy*:0='
 test_var PYTHON_SCRIPTDIR pypy /usr/lib/python-exec/pypy
 
-test_is python_is_python3 python2.7 1
-test_is python_is_python3 python3.2 0
-test_is python_is_python3 jython2.7 1
-test_is python_is_python3 pypy 1
+test_is "EPYTHON=python2.7 python_is_python3" 1
+test_is "EPYTHON=python3.2 python_is_python3" 0
+test_is "EPYTHON=jython2.7 python_is_python3" 1
+test_is "EPYTHON=pypy python_is_python3" 1
 
 # generic shebangs
 test_fix_shebang '#!/usr/bin/python' python2.7 '#!/usr/bin/python2.7'
@@ -135,6 +134,21 @@
        '#!/mnt/python2/usr/bin/python2.7 python2' --force
 test_fix_shebang '#!/usr/bin/foo' python2.7 FAIL
 
+# make sure we don't break pattern matching
+test_is "_python_impl_supported python2_5" 1
+test_is "_python_impl_supported python2_6" 1
+test_is "_python_impl_supported python2_7" 0
+test_is "_python_impl_supported python3_1" 1
+test_is "_python_impl_supported python3_2" 0
+test_is "_python_impl_supported python3_3" 0
+test_is "_python_impl_supported python3_4" 0
+test_is "_python_impl_supported pypy1_8" 1
+test_is "_python_impl_supported pypy1_9" 1
+test_is "_python_impl_supported pypy2_0" 1
+test_is "_python_impl_supported pypy" 0
+test_is "_python_impl_supported jython2_5" 0
+test_is "_python_impl_supported jython2_7" 0
+
 rm "${tmpfile}"
 
 texit




Reply via email to