mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-13 20:25:12 +00:00
Fix typo that worked on python 2.6.
Also, fix unit tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81194 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1,5 +1,3 @@
|
|||||||
import ShUtil
|
|
||||||
|
|
||||||
class Command:
|
class Command:
|
||||||
def __init__(self, args, redirects):
|
def __init__(self, args, redirects):
|
||||||
self.args = list(args)
|
self.args = list(args)
|
||||||
@ -26,6 +24,7 @@ class Command:
|
|||||||
print >>file, quoted,
|
print >>file, quoted,
|
||||||
|
|
||||||
# For debugging / validation.
|
# For debugging / validation.
|
||||||
|
import ShUtil
|
||||||
dequoted = list(ShUtil.ShLexer(quoted).lex())
|
dequoted = list(ShUtil.ShLexer(quoted).lex())
|
||||||
if dequoted != [arg]:
|
if dequoted != [arg]:
|
||||||
raise NotImplementedError,'Unable to quote %r' % arg
|
raise NotImplementedError,'Unable to quote %r' % arg
|
||||||
|
@ -184,7 +184,7 @@ class TclExecCommand:
|
|||||||
def parse_redirect(self, tok, length):
|
def parse_redirect(self, tok, length):
|
||||||
if len(tok) == length:
|
if len(tok) == length:
|
||||||
arg = self.lex()
|
arg = self.lex()
|
||||||
if next is None:
|
if arg is None:
|
||||||
raise ValueError,'Missing argument to %r redirection' % tok
|
raise ValueError,'Missing argument to %r redirection' % tok
|
||||||
else:
|
else:
|
||||||
tok,arg = tok[:length],tok[length:]
|
tok,arg = tok[:length],tok[length:]
|
||||||
@ -310,11 +310,11 @@ class TestTclExecCommand(unittest.TestCase):
|
|||||||
self.assertEqual(self.parse('echo hello > a >b >>c 2> d |& e'),
|
self.assertEqual(self.parse('echo hello > a >b >>c 2> d |& e'),
|
||||||
(False, False,
|
(False, False,
|
||||||
Pipeline([Command(['echo', 'hello'],
|
Pipeline([Command(['echo', 'hello'],
|
||||||
[(('>',),'a'),
|
[(('>&',2),'1'),
|
||||||
|
(('>',),'a'),
|
||||||
(('>',),'b'),
|
(('>',),'b'),
|
||||||
(('>>',),'c'),
|
(('>>',),'c'),
|
||||||
(('>',2),'d'),
|
(('>',2),'d')]),
|
||||||
(('>&',2),'1')]),
|
|
||||||
Command(['e'], [])],
|
Command(['e'], [])],
|
||||||
False, True)))
|
False, True)))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user