summaryrefslogtreecommitdiff
path: root/ccan/strgrp/test/api_iterate_two_groups.c
blob: ebf81a537b36efe729ef891426c43b44c181e55c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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();
}