aboutsummaryrefslogtreecommitdiffstats
path: root/utils/lit
diff options
context:
space:
mode:
Diffstat (limited to 'utils/lit')
-rw-r--r--utils/lit/ShCommands.py3
-rw-r--r--utils/lit/TclUtil.py8
2 files changed, 5 insertions, 6 deletions
diff --git a/utils/lit/ShCommands.py b/utils/lit/ShCommands.py
index be3e680..4550437 100644
--- a/utils/lit/ShCommands.py
+++ b/utils/lit/ShCommands.py
@@ -1,5 +1,3 @@
-import ShUtil
-
class Command:
def __init__(self, args, redirects):
self.args = list(args)
@@ -26,6 +24,7 @@ class Command:
print >>file, quoted,
# For debugging / validation.
+ import ShUtil
dequoted = list(ShUtil.ShLexer(quoted).lex())
if dequoted != [arg]:
raise NotImplementedError,'Unable to quote %r' % arg
diff --git a/utils/lit/TclUtil.py b/utils/lit/TclUtil.py
index da7659d..4a3f345 100644
--- a/utils/lit/TclUtil.py
+++ b/utils/lit/TclUtil.py
@@ -184,7 +184,7 @@ class TclExecCommand:
def parse_redirect(self, tok, length):
if len(tok) == length:
arg = self.lex()
- if next is None:
+ if arg is None:
raise ValueError,'Missing argument to %r redirection' % tok
else:
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'),
(False, False,
Pipeline([Command(['echo', 'hello'],
- [(('>',),'a'),
+ [(('>&',2),'1'),
+ (('>',),'a'),
(('>',),'b'),
(('>>',),'c'),
- (('>',2),'d'),
- (('>&',2),'1')]),
+ (('>',2),'d')]),
Command(['e'], [])],
False, True)))