tests: put usefull test functions in own files

This commit is contained in:
Khaïs COLIN 2025-03-11 15:59:59 +01:00
parent f5ae3a5d8d
commit 9707316085
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
12 changed files with 205 additions and 132 deletions

View file

@ -1,29 +1,19 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* quote_removal.c :+: :+: :+: */
/* test_quote_removal.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/28 13:46:56 by khais #+# #+# */
/* Updated: 2025/03/07 11:24:30 by khais ### ########.fr */
/* Updated: 2025/03/11 16:31:50 by khais ### ########.fr */
/* */
/* ************************************************************************** */
#include "../src/parser/wordlist/wordlist.h"
#include "../src/parser/wordsplit/wordsplit.h"
#include "../src/parser/remove_quotes/remove_quotes.h"
#include "testutil.h"
#include <assert.h>
static t_worddesc *create_single_word(char *str)
{
t_wordlist *words = minishell_wordsplit(str);
assert(wordlist_get(words, 0) != NULL);
assert(wordlist_get(words, 1) == NULL);
t_worddesc *word = wordlist_pop(&words);
return (word);
}
#include <stdlib.h>
static void test_quote_removal_no_quotes_single_word(void)
{