Drops the global-optind dependency from the test helper. Verb fixtures
stay inline as static const Verb[] — the section-based VERB() macro
would force unique verb names across the three test cases, which they
deliberately share to exercise overlap.
Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <getopt.h>
-
#include "strv.h"
#include "tests.h"
#include "verbs.h"
}
#define test_dispatch_one(argv, verbs, expected) \
- optind = 0; \
- assert_se(dispatch_verb(strv_length(argv), argv, verbs, NULL) == expected);
+ assert_se(_dispatch_verb_with_args(argv, verbs, verbs + ELEMENTSOF(verbs) - 1, NULL) == expected);
TEST(verbs) {
static const Verb verbs[] = {