diff options
author | Andrew Jeffery <andrew@aj.id.au> | 2015-08-20 15:46:31 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2015-09-09 04:31:39 +0930 |
commit | 7c7ad8cc84eb75d83222fb269d9c117c12c8e75c (patch) | |
tree | 0aacd9aa6abf762496fe29d2bb1b3462f3ce6ba7 /ccan/strgrp/test/api_iterate_two_groups.c | |
parent | 4ad5144790a12523f8a7c24c469a34907b6942a6 (diff) |
strgrp: new module
Diffstat (limited to 'ccan/strgrp/test/api_iterate_two_groups.c')
-rw-r--r-- | ccan/strgrp/test/api_iterate_two_groups.c | 18 |
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(); +} |