mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
tests: put usefull test functions in own files
This commit is contained in:
parent
f5ae3a5d8d
commit
9707316085
12 changed files with 205 additions and 132 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue