From: <otm...@us...> - 2010-06-01 22:59:28
|
Revision: 7060 http://jython.svn.sourceforge.net/jython/?rev=7060&view=rev Author: otmarhumbel Date: 2010-06-01 22:59:22 +0000 (Tue, 01 Jun 2010) Log Message: ----------- do not expand * in arguments any more (expected to fix #1567, #1594 and #1356) many thanks to Pekka Kl?\195?\164rck and Andreas Ebbert-Karroum for their analysis and suggestions! Modified Paths: -------------- trunk/jython/Lib/test/test_bat_jy.py trunk/jython/Lib/test/test_subprocess.py trunk/jython/src/shell/jython.bat Modified: trunk/jython/Lib/test/test_bat_jy.py =================================================================== --- trunk/jython/Lib/test/test_bat_jy.py 2010-05-31 04:36:44 UTC (rev 7059) +++ trunk/jython/Lib/test/test_bat_jy.py 2010-06-01 22:59:22 UTC (rev 7060) @@ -291,6 +291,12 @@ def test_doublequoted(self): self.assertOutput(['-c', '"print \'something\'"']) + def test_nestedquotes(self): + self.assertOutput(['-c', '"print \'something \"really\" cool\'"']) + + def test_nestedquotes2(self): + self.assertOutput(['-c', "'print \"something \'really\' cool\"'"]) + def test_underscored(self): self.assertOutput(['-jar', 'my_stuff.jar']) @@ -313,6 +319,25 @@ def test_jdb(self): self.assertOutput(['--jdb']) +class GlobPatternTest(BaseTest): + def test_star_nonexisting(self): + self.assertOutput(['-c', 'import sys; print sys.argv[1:]', '*.nonexisting', '*.nonexisting']) + + def test_star_nonexisting_doublequoted(self): + self.assertOutput(['-c', 'import sys; print sys.argv[1:]', '"*.nonexisting"', '"*.nonexisting"']) + + def test_star_nonexistingfile_singlequoted(self): + self.assertOutput(['-c', 'import sys; print sys.argv[1:]', "'*.nonexisting'", "'*.nonexisting'"]) + + def test_star_existing(self): + self.assertOutput(['-c', 'import sys; print sys.argv[1:]', '*.bat', '*.bat']) + + def test_star_existing_doublequoted(self): + self.assertOutput(['-c', 'import sys; print sys.argv[1:]', '"*.bat"', '"*.bat"']) + + def test_star_existing_singlequoted(self): + self.assertOutput(['-c', 'import sys; print sys.argv[1:]', "'*.bat'", "'*.bat'"]) + class DummyTest(unittest.TestCase): def test_nothing(self): pass @@ -325,7 +350,8 @@ JythonOptsTest, JavaOptsTest, ArgsTest, - DoubleDashTest) + DoubleDashTest, + GlobPatternTest) else: # provide at least one test for the other platforms - happier build bots test_support.run_unittest(DummyTest) Modified: trunk/jython/Lib/test/test_subprocess.py =================================================================== --- trunk/jython/Lib/test/test_subprocess.py 2010-05-31 04:36:44 UTC (rev 7059) +++ trunk/jython/Lib/test/test_subprocess.py 2010-06-01 22:59:22 UTC (rev 7060) @@ -707,7 +707,8 @@ def test_main(): # Spawning many new jython processes takes a long time - test_support.requires('subprocess') + # TODO:oti uncomment the next line as soon as the fix to #1356 is verified on the build bots + #test_support.requires('subprocess') test_support.run_unittest(ProcessTestCase) if hasattr(test_support, "reap_children"): test_support.reap_children() Modified: trunk/jython/src/shell/jython.bat =================================================================== --- trunk/jython/src/shell/jython.bat 2010-05-31 04:36:44 UTC (rev 7059) +++ trunk/jython/src/shell/jython.bat 2010-06-01 22:59:22 UTC (rev 7060) @@ -106,7 +106,7 @@ :getArg rem remove quotes around first arg -for %%i in (%1) do set _CMP=%%~i +set _CMP=%~1 set _ARGS=%2 goto :EOF @@ -140,7 +140,7 @@ goto :nextArg ) -rem now unescape _D, _S and _Q +rem now unescape _D, _S and _U set _CMP=%_CMP:_D="% set _CMP=%_CMP:_S='% set _CMP=%_CMP:_U=_% This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |