aboutsummaryrefslogtreecommitdiff
path: root/test/src/dstr/test_ft_dstrsubstitute.c
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-10-11 14:53:20 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-10-11 14:53:20 +0200
commit39951f08a2938683d800c677c3a244e9ff8dbe19 (patch)
tree9321278f57c91d070e269fc2d2f95d4f2cb00fdf /test/src/dstr/test_ft_dstrsubstitute.c
parent306a69eb9ae88813cf0be0aa3e001481e12220a1 (diff)
downloadlibft-39951f08a2938683d800c677c3a244e9ff8dbe19.tar.gz
libft-39951f08a2938683d800c677c3a244e9ff8dbe19.tar.bz2
libft-39951f08a2938683d800c677c3a244e9ff8dbe19.zip
Removing none c,h files for correction
Diffstat (limited to 'test/src/dstr/test_ft_dstrsubstitute.c')
-rw-r--r--test/src/dstr/test_ft_dstrsubstitute.c64
1 files changed, 0 insertions, 64 deletions
diff --git a/test/src/dstr/test_ft_dstrsubstitute.c b/test/src/dstr/test_ft_dstrsubstitute.c
deleted file mode 100644
index d81b944..0000000
--- a/test/src/dstr/test_ft_dstrsubstitute.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* test_ft_dstrsubstitute.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/04/01 19:41:59 by charles #+# #+# */
-/* Updated: 2020/04/05 01:09:47 by charles ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_test.h"
-
-TEST_GROUP(ft_dstrsubstitute);
-
-TEST_SETUP(ft_dstrsubstitute)
-{}
-
-TEST_TEAR_DOWN(ft_dstrsubstitute)
-{}
-
-TEST(ft_dstrsubstitute, basic)
-{
- t_ftdstr *dstr;
-
- dstr = ft_dstrnew("bonjour");
- TEST_ASSERT_NULL(ft_dstrsubstitute(dstr, "bonjour", 8, 1));
-
- TEST_ASSERT_NOT_NULL(ft_dstrsubstitute(dstr, "{{{", 0, 0));
- TEST_ASSERT_NOT_NULL(dstr);
- TEST_ASSERT_NOT_NULL(dstr->str);
- TEST_ASSERT_EQUAL(10, dstr->length);
- TEST_ASSERT_GREATER_OR_EQUAL(11, dstr->capacity);
- TEST_ASSERT_EQUAL_STRING("{{{bonjour", dstr->str);
-
- TEST_ASSERT_NOT_NULL(ft_dstrsubstitute(dstr, "]]]", dstr->length, 0));
- TEST_ASSERT_NOT_NULL(dstr);
- TEST_ASSERT_NOT_NULL(dstr->str);
- TEST_ASSERT_EQUAL(13, dstr->length);
- TEST_ASSERT_GREATER_OR_EQUAL(14, dstr->capacity);
- TEST_ASSERT_EQUAL_STRING("{{{bonjour]]]", dstr->str);
-
- TEST_ASSERT_NOT_NULL(ft_dstrsubstitute(dstr, "aurevoir", 3, 7));
- TEST_ASSERT_NOT_NULL(dstr);
- TEST_ASSERT_NOT_NULL(dstr->str);
- TEST_ASSERT_EQUAL(14, dstr->length);
- TEST_ASSERT_GREATER_OR_EQUAL(15, dstr->capacity);
- TEST_ASSERT_EQUAL_STRING("{{{aurevoir]]]", dstr->str);
-
- TEST_ASSERT_NOT_NULL(ft_dstrsubstitute(dstr, "<>", 0, dstr->length));
- TEST_ASSERT_NOT_NULL(dstr);
- TEST_ASSERT_NOT_NULL(dstr->str);
- TEST_ASSERT_EQUAL(2, dstr->length);
- TEST_ASSERT_GREATER_OR_EQUAL(3, dstr->capacity);
- TEST_ASSERT_EQUAL_STRING("<>", dstr->str);
-
- TEST_ASSERT_NOT_NULL(ft_dstrsubstitute(dstr, "<>", 0, dstr->length));
- TEST_ASSERT_NOT_NULL(dstr);
- TEST_ASSERT_NOT_NULL(dstr->str);
- TEST_ASSERT_EQUAL(2, dstr->length);
- TEST_ASSERT_GREATER_OR_EQUAL(3, dstr->capacity);
- TEST_ASSERT_EQUAL_STRING("<>", dstr->str);
-}