ok1(tal_check(ctx, NULL));
tal_free(split);
/* Previous free should get rid of str */
ok1(tal_check(ctx, NULL));
tal_free(split);
/* Previous free should get rid of str */
/* tal_strsplit take delims */
str = tal_strdup(ctx, " ");
/* tal_strsplit take delims */
str = tal_strdup(ctx, " ");
/* tal_strsplit takes both. */
split = tal_strsplit(ctx, take(tal_strdup(NULL, "hello world")),
/* tal_strsplit takes both. */
split = tal_strsplit(ctx, take(tal_strdup(NULL, "hello world")),
ok1(tal_check(ctx, NULL));
tal_free(split);
/* temp allocs are gone... */
ok1(tal_check(ctx, NULL));
tal_free(split);
/* temp allocs are gone... */
/* tal_strjoin passthrough taken NULLs OK. */
ok1(tal_strjoin(ctx, take(NULL), "", STR_TRAIL) == NULL);
/* tal_strjoin passthrough taken NULLs OK. */
ok1(tal_strjoin(ctx, take(NULL), "", STR_TRAIL) == NULL);
ok1(!strcmp(str, "hello there world"));
ok1(tal_parent(str) == ctx);
/* split is gone... */
ok1(!strcmp(str, "hello there world"));
ok1(tal_parent(str) == ctx);
/* split is gone... */
/* tal_strjoin take delim */
split = tal_strsplit(ctx, "hello world", " ", STR_EMPTY_OK);
/* tal_strjoin take delim */
split = tal_strsplit(ctx, "hello world", " ", STR_EMPTY_OK);
ok1(tal_parent(str) == ctx);
tal_free(split);
/* tmp alloc is gone, str is only remainder. */
ok1(tal_parent(str) == ctx);
tal_free(split);
/* tmp alloc is gone, str is only remainder. */
/* tal_strjoin take both. */
str = tal_strjoin(ctx, take(tal_strsplit(ctx, "hello world", " ",
/* tal_strjoin take both. */
str = tal_strjoin(ctx, take(tal_strsplit(ctx, "hello world", " ",
ok1(!strcmp(str, "hello there world"));
ok1(tal_parent(str) == ctx);
/* tmp allocs are gone, str is only remainder. */
ok1(!strcmp(str, "hello there world"));
ok1(tal_parent(str) == ctx);
/* tmp allocs are gone, str is only remainder. */