]> git.ozlabs.org Git - ccan/blobdiff - ccan/strgrp/test/api_test_free_cb.c
strgrp: new module
[ccan] / ccan / strgrp / test / api_test_free_cb.c
diff --git a/ccan/strgrp/test/api_test_free_cb.c b/ccan/strgrp/test/api_test_free_cb.c
new file mode 100644 (file)
index 0000000..bf85b36
--- /dev/null
@@ -0,0 +1,16 @@
+#include "../test/helpers.h"
+
+static void
+data_cb(void *data) {
+    ok1(streq("1", (char *)data));
+}
+
+int main(void) {
+    struct strgrp *ctx;
+
+    plan_tests(1);
+    create(ctx, DEFAULT_SIMILARITY);
+    strgrp_add(ctx, "a", (void *)"1");
+    strgrp_free_cb(ctx, &data_cb);
+    return exit_status();
+}