Added more tests and fixed some issues

This commit is contained in:
Paul H 2025-06-13 21:36:17 +02:00
parent 3ec833a5bd
commit b557fa1c3d

View File

@ -18,7 +18,8 @@ class ParserTest {
testInput(parser, "ls -la ./what", "ls", List.of("l", "a"), List.of("./what"));
testInput(parser, "rm -r /bin /opt", "rm", List.of("r"), List.of("/bin", "/opt"));
testInput(parser, "cd .", "cd", List.of(), List.of("."));
testInput(parser, "mkdir .", "cd", List.of(), List.of("."));
testInput(parser, "mkdir .", "mkdir", List.of(), List.of("."));
testInput(parser, "super -abc -de -f super nice danke paul", "super", List.of("a", "b", "c", "d", "e", "f"), List.of("super", "nice", "danke", "paul"));
}
private void testInput(Parser parser, String input, String expectedCommand, List<String> expectedFlags, List<String> expectedArgs) {