]> git.ozlabs.org Git - ccan/blob - ccan/strgrp/test/api_iterate_two_groups.c
strgrp: new module
[ccan] / ccan / strgrp / test / api_iterate_two_groups.c
1 #include "../test/helpers.h"
2
3 int main(void) {
4     struct strgrp *ctx;
5     struct strgrp_iter *iter;
6
7     plan_tests(3);
8     create(ctx, DEFAULT_SIMILARITY);
9     strgrp_add(ctx, "a", NULL);
10     strgrp_add(ctx, "b", NULL);
11     iter = strgrp_iter_new(ctx);
12     ok1(strgrp_iter_next(iter));
13     ok1(strgrp_iter_next(iter));
14     ok1(!strgrp_iter_next(iter));
15     strgrp_iter_free(iter);
16     strgrp_free(ctx);
17     return exit_status();
18 }