-
Notifications
You must be signed in to change notification settings - Fork 0
/
gnl_simple_test.c
31 lines (28 loc) · 1.23 KB
/
gnl_simple_test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* gnl_simple_test.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abenamar <abenamar@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/13 18:57:37 by abenamar #+# #+# */
/* Updated: 2023/04/19 07:04:55 by abenamar ### ########.fr */
/* */
/* ************************************************************************** */
#include "get_next_line_test.h"
void gnl_simple_test(void)
{
const char *filename = "files/simple";
const int fd = open(filename, O_RDONLY);
char *s;
printf(RESET "\n%s \t\t", filename);
if (fd < 0)
exit(1);
s = get_next_line(fd);
ft_assert(1, !strcmp(s, "test\n"));
free(s);
s = get_next_line(fd);
ft_assert(2, s == NULL);
if (close(fd) < 0)
exit(1);
}