Skip to content

Commit

Permalink
Merge: lexer_parser
Browse files Browse the repository at this point in the history
  • Loading branch information
frouioui committed May 25, 2018
1 parent 70f84e1 commit e56ae1f
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions tests/parsing/get_pipe_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,3 @@ Test(get_pipe_1, 1_pipe_value, .timeout = 0.2)
cr_assert_str_eq(pipe[0]->args[0], "ls");
cr_assert_str_eq(pipe[0]->args[1], "-l");
}

Test(get_pipe_1, 2_pipes_value, .timeout = 0.2)
{
instruction_t *inst = malloc(sizeof(instruction_t));
pipe_t **pipe = NULL;
char str[] = "ls -l | grep \"tty\"";
char **env = malloc(sizeof(char *));

env[0] = my_strcpy(env[0], "TOTO=/bin");
inst->full_instruction = my_strcpy(inst->full_instruction, str);
inst->number_of_pipe = 2;
inst->actual_pipe = 0;
pipe = get_pipe(false, inst, env, NULL);
cr_assert_not_null(pipe);
cr_assert_not_null(pipe[0]);
cr_assert_not_null(pipe[1]);
cr_assert_str_eq(pipe[0]->full_instruction, "ls -l");
cr_assert_str_eq(pipe[0]->args[0], "ls");
cr_assert_str_eq(pipe[0]->args[1], "-l");
cr_assert_str_eq(pipe[1]->full_instruction, "grep \"tty\"");
cr_assert_str_eq(pipe[1]->args[0], "grep");
cr_assert_str_eq(pipe[1]->args[1], "\"tty\"");
}

0 comments on commit e56ae1f

Please sign in to comment.