aboutsummaryrefslogtreecommitdiff
path: root/test/src/dstr/test_ft_dstrunwrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/dstr/test_ft_dstrunwrap.c')
-rw-r--r--test/src/dstr/test_ft_dstrunwrap.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/src/dstr/test_ft_dstrunwrap.c b/test/src/dstr/test_ft_dstrunwrap.c
new file mode 100644
index 0000000..dbc334a
--- /dev/null
+++ b/test/src/dstr/test_ft_dstrunwrap.c
@@ -0,0 +1,42 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* test_ft_dstrunwrap.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/04/01 19:41:59 by charles #+# #+# */
+/* Updated: 2020/04/04 21:07:16 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_test.h"
+
+TEST_GROUP(ft_dstrunwrap);
+
+TEST_SETUP(ft_dstrunwrap)
+{}
+
+TEST_TEAR_DOWN(ft_dstrunwrap)
+{}
+
+TEST(ft_dstrunwrap, basic)
+{
+ t_ftdstr *dstr;
+ char *ret;
+
+ dstr = ft_dstrnew("bonjour");
+ ret = ft_dstrunwrap(dstr);
+ TEST_ASSERT_NOT_NULL(ret);
+ TEST_ASSERT_EQUAL_STRING("bonjour", ret);
+
+ dstr = ft_dstrnew("");
+ ret = ft_dstrunwrap(dstr);
+ TEST_ASSERT_NOT_NULL(ret);
+ TEST_ASSERT_EQUAL_STRING("", ret);
+
+ dstr = ft_dstrnew("hidden\0text");
+ ret = ft_dstrunwrap(dstr);
+ TEST_ASSERT_NOT_NULL(ret);
+ TEST_ASSERT_EQUAL_STRING("hidden", ret);
+}