]> git.ozlabs.org Git - ccan/blobdiff - ccan/tal/test/run-string.c
tal/str: move tal string functions here from tal.
[ccan] / ccan / tal / test / run-string.c
diff --git a/ccan/tal/test/run-string.c b/ccan/tal/test/run-string.c
deleted file mode 100644 (file)
index 0155ecb..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <ccan/tal/tal.h>
-#include <ccan/tal/tal.c>
-#include <ccan/tap/tap.h>
-
-int main(void)
-{
-       char *parent, *c;
-
-       plan_tests(13);
-
-       parent = tal(NULL, char);
-       ok1(parent);
-
-       c = tal_strdup(parent, "hello");
-       ok1(strcmp(c, "hello") == 0);
-       ok1(tal_parent(c) == parent);
-
-       c = tal_strndup(parent, "hello", 3);
-       ok1(strcmp(c, "hel") == 0);
-       ok1(tal_parent(c) == parent);
-
-       c = tal_typechk_(parent, char *);
-       c = tal_dup(parent, char, "hello", 6, 0);
-       ok1(strcmp(c, "hello") == 0);
-       ok1(strcmp(tal_name(c), "char[]") == 0);
-       ok1(tal_parent(c) == parent);
-
-       /* Now with an extra byte. */
-       c = tal_dup(parent, char, "hello", 6, 1);
-       ok1(strcmp(c, "hello") == 0);
-       ok1(strcmp(tal_name(c), "char[]") == 0);
-       ok1(tal_parent(c) == parent);
-       strcat(c, "x");
-
-       c = tal_asprintf(parent, "hello %s", "there");
-       ok1(strcmp(c, "hello there") == 0);
-       ok1(tal_parent(c) == parent);
-       tal_free(parent);
-
-       return exit_status();
-}