summaryrefslogtreecommitdiff
path: root/ccan/strgrp/test/api_iterate_two_groups.c
diff options
context:
space:
mode:
Diffstat (limited to 'ccan/strgrp/test/api_iterate_two_groups.c')
-rw-r--r--ccan/strgrp/test/api_iterate_two_groups.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/ccan/strgrp/test/api_iterate_two_groups.c b/ccan/strgrp/test/api_iterate_two_groups.c
new file mode 100644
index 00000000..ebf81a53
--- /dev/null
+++ b/ccan/strgrp/test/api_iterate_two_groups.c
@@ -0,0 +1,18 @@
+#include "../test/helpers.h"
+
+int main(void) {
+ struct strgrp *ctx;
+ struct strgrp_iter *iter;
+
+ plan_tests(3);
+ create(ctx, DEFAULT_SIMILARITY);
+ strgrp_add(ctx, "a", NULL);
+ strgrp_add(ctx, "b", NULL);
+ iter = strgrp_iter_new(ctx);
+ ok1(strgrp_iter_next(iter));
+ ok1(strgrp_iter_next(iter));
+ ok1(!strgrp_iter_next(iter));
+ strgrp_iter_free(iter);
+ strgrp_free(ctx);
+ return exit_status();
+}