aboutsummaryrefslogtreecommitdiff
path: root/test/src/ht/test_ftht_entry_new.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-04-01 21:51:51 +0200
committerCharles <sircharlesaze@gmail.com>2020-04-01 21:58:05 +0200
commit65c5d5157e890e9f9445a94fb2d7f660e5492d8e (patch)
tree78613f26bdc531104c3e32d76ffcaf3c2f7013f5 /test/src/ht/test_ftht_entry_new.c
parentc128213daa677d548bfc2905496257fe4a4faf79 (diff)
parenta1675f56b35f5521a91851bae8ca650706374ae6 (diff)
downloadlibft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.tar.gz
libft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.tar.bz2
libft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.zip
Merge branch 'minishell'
Diffstat (limited to 'test/src/ht/test_ftht_entry_new.c')
-rw-r--r--test/src/ht/test_ftht_entry_new.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/src/ht/test_ftht_entry_new.c b/test/src/ht/test_ftht_entry_new.c
new file mode 100644
index 0000000..a566600
--- /dev/null
+++ b/test/src/ht/test_ftht_entry_new.c
@@ -0,0 +1,43 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* test_ft_htentry_new.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/17 04:07:04 by cacharle #+# #+# */
+/* Updated: 2020/02/17 04:15:39 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_test.h"
+
+TEST_GROUP(ft_htentry_new);
+
+TEST_SETUP(ft_htentry_new)
+{}
+
+TEST_TEAR_DOWN(ft_htentry_new)
+{}
+
+TEST(ft_htentry_new, basic)
+{
+ t_ftht_entry *c = NULL;
+
+ char *k = "bonjour";
+ c = ft_htentry_new(k, NULL);
+ TEST_ASSERT_NOT_NULL(c);
+ TEST_ASSERT(k != c->key);
+ TEST_ASSERT_EQUAL_STRING(k, c->key);
+ TEST_ASSERT_NULL(c->value);
+
+ c = ft_htentry_new(k, k);
+ TEST_ASSERT_NOT_NULL(c);
+ TEST_ASSERT(k != c->key);
+ TEST_ASSERT_EQUAL_STRING(k, c->key);
+ TEST_ASSERT_EQUAL_PTR(k, c->value);
+ TEST_ASSERT_EQUAL_STRING(k, (char*)c->value);
+
+ /* free(c->key); */
+ /* free(c); */
+}