[pypy-svn] r8881 - pypy/dist/pypy/interpreter/test

tismer at codespeak.net tismer at codespeak.net
Fri Feb 4 21:53:16 CET 2005


Author: tismer
Date: Fri Feb  4 21:53:15 2005
New Revision: 8881

Modified:
   pypy/dist/pypy/interpreter/test/test_py.py
Log:
patched cmdexec.py for Win32:
The problem is that there are very special rules for double quotes.
Also had to patch the pypy tests:
Single quotes are not recognized under Windows.
This is a compromise, anyway.

Modified: pypy/dist/pypy/interpreter/test/test_py.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_py.py	(original)
+++ pypy/dist/pypy/interpreter/test/test_py.py	Fri Feb  4 21:53:15 2005
@@ -9,28 +9,28 @@
 def test_executable():
     """Ensures sys.executable points to the py.py script"""
     # TODO : watch out for spaces/special chars in pypath
-    output = py.process.cmdexec( '''"%s" -c 'import sys;print sys.executable' ''' % pypath )
+    output = py.process.cmdexec( '''"%s" -c "import sys;print sys.executable" ''' % pypath )
     assert output.splitlines()[-1] == pypath
 
 def test_prefix():
     """Make sure py.py sys.prefix and exec_prefix are the same as C Python's"""
-    output = py.process.cmdexec( '''"%s" -c 'import sys;print sys.prefix' ''' % pypath )
+    output = py.process.cmdexec( '''"%s" -c "import sys;print sys.prefix" ''' % pypath )
     assert output.splitlines()[-1] == sys.prefix
-    output = py.process.cmdexec( '''"%s" -c 'import sys;print sys.exec_prefix' ''' % pypath )
+    output = py.process.cmdexec( '''"%s" -c "import sys;print sys.exec_prefix" ''' % pypath )
     assert output.splitlines()[-1] == sys.exec_prefix
 
 def test_argv_command():
     """Some tests on argv"""
     # test 1 : no arguments
-    output = py.process.cmdexec( '''"%s" -c 'import sys;print sys.argv' ''' % pypath )
+    output = py.process.cmdexec( '''"%s" -c "import sys;print sys.argv" ''' % pypath )
     assert output.splitlines()[-1] == str(['-c'])
 
     # test 2 : some arguments after
-    output = py.process.cmdexec( '''"%s" -c 'import sys;print sys.argv' hello''' % pypath )
+    output = py.process.cmdexec( '''"%s" -c "import sys;print sys.argv" hello''' % pypath )
     assert output.splitlines()[-1] == str(['-c','hello'])
     
     # test 3 : additionnal pypy parameters
-    output = py.process.cmdexec( '''"%s" -O -c 'import sys;print sys.argv' hello''' % pypath )
+    output = py.process.cmdexec( '''"%s" -O -c "import sys;print sys.argv" hello''' % pypath )
     assert output.splitlines()[-1] == str(['-c','hello'])
 
 SCRIPT_1 = """



More information about the Pypy-commit mailing list