diff options
| author | nass1pro <nass1pro@gmail.com> | 2020-06-09 19:48:34 +0200 |
|---|---|---|
| committer | nass1pro <nass1pro@gmail.com> | 2020-06-13 11:31:00 +0200 |
| commit | 579a26f5593039ffbbd1a81e45ecf0ef8797cb5d (patch) | |
| tree | c5b6761db98e27d15bab3fb45ba9e0a646cf06e0 /test_mini/libft/test/src/mem/test_ft_memset_pattern4.c | |
| parent | 9fabc25a980550afc6337fd729632462f2680daa (diff) | |
| download | minishell-579a26f5593039ffbbd1a81e45ecf0ef8797cb5d.tar.gz minishell-579a26f5593039ffbbd1a81e45ecf0ef8797cb5d.tar.bz2 minishell-579a26f5593039ffbbd1a81e45ecf0ef8797cb5d.zip | |
add lexer
add single quote
Diffstat (limited to 'test_mini/libft/test/src/mem/test_ft_memset_pattern4.c')
| -rw-r--r-- | test_mini/libft/test/src/mem/test_ft_memset_pattern4.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test_mini/libft/test/src/mem/test_ft_memset_pattern4.c b/test_mini/libft/test/src/mem/test_ft_memset_pattern4.c new file mode 100644 index 0000000..0e2806a --- /dev/null +++ b/test_mini/libft/test/src/mem/test_ft_memset_pattern4.c @@ -0,0 +1,42 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* test_ft_memset_pattern4.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/13 03:32:43 by cacharle #+# #+# */ +/* Updated: 2020/02/13 19:57:48 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft_test.h" + +TEST_GROUP(ft_memset_pattern4); + +TEST_SETUP(ft_memset_pattern4) +{} + +TEST_TEAR_DOWN(ft_memset_pattern4) +{} + +TEST(ft_memset_pattern4, basic) +{ + char buf[17] = {0}; + char *pattern4 = "1234"; + + ft_memset_pattern4(buf, pattern4, 16); + TEST_ASSERT_EQUAL_STRING("1234123412341234", buf); + + char buf1[10] = {0}; + ft_memset_pattern4(buf1, "1234", 9); + TEST_ASSERT_EQUAL_STRING("123412341", buf1); + + char buf2[11] = {0}; + ft_memset_pattern4(buf2, "1234", 10); + TEST_ASSERT_EQUAL_STRING("1234123412", buf2); + + char buf3[12] = {0}; + ft_memset_pattern4(buf3, "1234", 11); + TEST_ASSERT_EQUAL_STRING("12341234123", buf3); +} |
