diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-24 08:29:37 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-24 08:29:37 -0800 |
| commit | 895ea654581ef9928e554366fbd93f613a049017 (patch) | |
| tree | 1962e2d457f1a2093c27451d0d8767552fff336c /src | |
| parent | 77f85a4d2b46e1ccc34a4c86e8c97392fa73e280 (diff) | |
| download | nng-895ea654581ef9928e554366fbd93f613a049017.tar.gz nng-895ea654581ef9928e554366fbd93f613a049017.tar.bz2 nng-895ea654581ef9928e554366fbd93f613a049017.zip | |
option parser: test for no clustering support
Diffstat (limited to 'src')
| -rw-r--r-- | src/supplemental/util/options_test.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/supplemental/util/options_test.c b/src/supplemental/util/options_test.c index e365f97e..036f2940 100644 --- a/src/supplemental/util/options_test.c +++ b/src/supplemental/util/options_test.c @@ -302,6 +302,26 @@ test_missing_arg(void) NUTS_FAIL(nng_opts_parse(ac, av, spec, &v, &a, &opti), NNG_ENOARG); } +void +test_no_clustering(void) +{ + int opti = 1; + char *av[2]; + int ac = 2; + int v; + char *a = NULL; + + nng_optspec spec[] = { + { "flag", 'f', 1, false }, + { "verbose", 'v', 2, false }, + { NULL, 0, 0, false }, + }; + + av[0] = "program"; + av[1] = "-fv"; + NUTS_FAIL(nng_opts_parse(ac, av, spec, &v, &a, &opti), NNG_EINVAL); +} + NUTS_TESTS = { { "simple options", test_simple_options }, { "long options", test_long_options }, @@ -316,5 +336,6 @@ NUTS_TESTS = { { "options mixed long short", test_mixed_long_short }, { "ambiguous options", test_ambiguous }, { "missing argument", test_missing_arg }, + { "no clustering", test_no_clustering }, { NULL, NULL }, }; |
