From 579a26f5593039ffbbd1a81e45ecf0ef8797cb5d Mon Sep 17 00:00:00 2001 From: nass1pro Date: Tue, 9 Jun 2020 19:48:34 +0200 Subject: add lexer add single quote --- test_mini/libft/test/src/mem/test_ft_memmove.c | 39 ++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test_mini/libft/test/src/mem/test_ft_memmove.c (limited to 'test_mini/libft/test/src/mem/test_ft_memmove.c') diff --git a/test_mini/libft/test/src/mem/test_ft_memmove.c b/test_mini/libft/test/src/mem/test_ft_memmove.c new file mode 100644 index 0000000..158cda9 --- /dev/null +++ b/test_mini/libft/test/src/mem/test_ft_memmove.c @@ -0,0 +1,39 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* test_ft_memmove.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/13 03:34:21 by cacharle #+# #+# */ +/* Updated: 2020/02/13 19:49:07 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft_test.h" + +TEST_GROUP(ft_memmove); + +TEST_SETUP(ft_memmove) +{} + +TEST_TEAR_DOWN(ft_memmove) +{} + +TEST(ft_memmove, basic) +{ + char buf1[32] = "bonjour"; + + char *ptr = ft_memmove(buf1, buf1 + 2, 29); + TEST_ASSERT_EQUAL_PTR(buf1, ptr); + TEST_ASSERT_EQUAL_STRING("njour", buf1); + + ptr = ft_memmove(buf1 + 2, buf1, 29); + TEST_ASSERT_EQUAL_PTR(buf1 + 2, ptr); + TEST_ASSERT_EQUAL_STRING("njour", ptr); + TEST_ASSERT_EQUAL_STRING("njnjour", buf1); + + ptr = ft_memmove(buf1, buf1, 32); + TEST_ASSERT_EQUAL_PTR(buf1, ptr); + TEST_ASSERT_EQUAL_STRING("njnjour", ptr); +} -- cgit