tal: add typenames by default.
[ccan] / ccan / tal / test / run-named.c
index d2c9b9e1f7539cade4e447279426a3f9d7d833a4..acdc4513c2e9e83e82535e06a7f03d608a6123bc 100644 (file)
@@ -7,10 +7,10 @@ int main(void)
        int *p;
        char name[] = "test name";
 
-       plan_tests(5);
+       plan_tests(6);
 
        p = tal(NULL, int);
-       ok1(tal_name(p) == NULL);
+       ok1(strcmp(tal_name(p), "int") == 0);
 
        tal_set_name(p, "some literal");
        ok1(strcmp(tal_name(p), "some literal") == 0);
@@ -25,5 +25,9 @@ int main(void)
 
        tal_free(p);
 
+       p = tal_arr(NULL, int, 2);
+       ok1(strcmp(tal_name(p), "int[]") == 0);
+       tal_free(p);
+
        return exit_status();
 }