summaryrefslogtreecommitdiffstats
path: root/02_exercise/process_test.c
diff options
context:
space:
mode:
Diffstat (limited to '02_exercise/process_test.c')
-rw-r--r--02_exercise/process_test.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/02_exercise/process_test.c b/02_exercise/process_test.c
index 89eb2fb..dc3a291 100644
--- a/02_exercise/process_test.c
+++ b/02_exercise/process_test.c
@@ -43,7 +43,20 @@ void test_pipe() {
assert(processes[1].in_fd != 0);
free_processes(&processes);
}
+
+void test_ls(){
+ process * processes= NULL;
+ parse_line("ls", &processes);
+ assert(arrayLen(processes) == 1);
+ process p = processes[0];
+ assert(arrayLen(p.argv)==2);
+ assert(p.argc == 1);
+ assert(strcmp(p.argv[0], "ls") == 0);
+ assert(p.argc[p.argv] == NULL);
+ free_processes(&processes);
+}
int main() {
+ test_ls();
test_simple_case();
test_detatched();
test_pipe();