Fix some tests

This commit is contained in:
Florian Bruhin 2014-11-05 21:42:27 +01:00
parent 714ba530d3
commit 1d9b60d733

View File

@ -164,4 +164,14 @@ def split(s, keep=False):
"""
lexer = ShellLexer(s)
lexer.keep = keep
return list(lexer)
tokens = list(lexer)
out = []
if tokens[0].isspace():
out.append(tokens[0] + tokens[1])
tokens = tokens[2:]
for t in tokens:
if t.isspace():
out[-1] += t
else:
out.append(t)
return out