doCompletionTest("echo hi > /", "TETZ");
}
private void doCompletionTest(String input, String flags)
throws ShellSyntaxException, CompletionException {
BjorneInterpreter interpreter = new BjorneInterpreter();
for (int i = 0; i <= input.length(); i++) {
String partial = input.substring(0, i);
int inWord = 0;
int wordStart = 0;
for (int j = 0; j < i; j++) {
if (Character.isWhitespace(partial.charAt(j))) {
inWord++;
wordStart = j + 1;
}
}
String lastWord = partial.substring(wordStart);
Completable completable = interpreter.parsePartial(shell, partial);
CommandCompletions completions = new CommandCompletions();
completable.complete(completions, shell);
Set<String> completionWords = completions.getCompletions();
switch (flags.charAt(inWord)) {
case 'T':