mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
here_doc: generate random filenames
This commit is contained in:
parent
0486368a07
commit
99babbf6d2
3 changed files with 69 additions and 4 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/07 11:43:32 by khais #+# #+# */
|
||||
/* Updated: 2025/03/10 18:21:43 by khais ### ########.fr */
|
||||
/* Updated: 2025/03/10 18:23:36 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -14,6 +14,27 @@
|
|||
#include "testutil.h"
|
||||
#include "libft.h"
|
||||
#include <unistd.h>
|
||||
#include "../src/executing/here_doc/here_doc.h"
|
||||
|
||||
static void test_here_doc_filename_generation(void)
|
||||
{
|
||||
char *filename1;
|
||||
char *filename2;
|
||||
|
||||
ft_dprintf(STDERR_FILENO, "==> %s <==\n", __FUNCTION__);
|
||||
filename1 = here_doc_random_filename();
|
||||
filename2 = here_doc_random_filename();
|
||||
assert(filename1 != NULL);
|
||||
assert(filename2 != NULL);
|
||||
ft_dprintf(STDERR_FILENO, "Got filename: [%s]\n", filename1);
|
||||
ft_dprintf(STDERR_FILENO, "Got filename: [%s]\n", filename2);
|
||||
assert(ft_strcmp(filename1, filename2) != 0);
|
||||
free(filename1);
|
||||
free(filename2);
|
||||
do_leak_check();
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
test_here_doc_filename_generation();
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue