2017-05-15 22:08:07 +00:00
|
|
|
//
|
|
|
|
// Created by Antoine Bartuccio on 15/05/2017.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "FishCoreTests.h"
|
|
|
|
#include "../fish_shell/fish_core.c"
|
2017-05-15 23:33:36 +00:00
|
|
|
#include "../fish_shell/fish_utils.c"
|
|
|
|
#include "../fish_shell/fish_commands.c"
|
|
|
|
#include "../fish_shell/fish_globbing.c"
|
2017-05-15 22:08:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
//TEST_F(FishCoreTests, split){
|
|
|
|
// ASSERT_TRUE(true);
|
|
|
|
//}
|
|
|
|
|
2017-05-15 23:33:36 +00:00
|
|
|
TEST(command_split, split){
|
2017-05-15 22:08:07 +00:00
|
|
|
char input[] = "git push --force";
|
|
|
|
char *output[] = {
|
|
|
|
(char *) "git",
|
|
|
|
(char *) "push",
|
|
|
|
(char *) "--force"
|
|
|
|
};
|
|
|
|
WordList *list = split(input, (char *) FISH_TOKENS);
|
|
|
|
WordListElement *current = list->first;
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
ASSERT_FALSE(current == NULL);
|
|
|
|
while(current != NULL){
|
|
|
|
ASSERT_STREQ(current->word, output[i]);
|
|
|
|
current = current->next;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
freeWordList(list);
|
|
|
|
|
|
|
|
}
|