X-Git-Url: http://git.efficios.com/?p=argpar.git;a=blobdiff_plain;f=tests%2Ftest_argpar.c;h=fee82a9ed06031c32ae5dc70ff159735c3f6da75;hp=c78b6e8a6babb71c7b362ba62eb45932e84644fb;hb=d1f7bbdbd28b96b360e815f28697a2f81d699cb4;hpb=dd757a651292048da829dd6fa085c1f107569bcc diff --git a/tests/test_argpar.c b/tests/test_argpar.c index c78b6e8..fee82a9 100644 --- a/tests/test_argpar.c +++ b/tests/test_argpar.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -650,6 +651,34 @@ void succeed_tests(void) "-f --<1,0> -f", descrs, 3); } + + /* Very long name of long option */ + { + const char opt_name[] = + "kale-chips-waistcoat-yr-bicycle-rights-gochujang-" + "woke-tumeric-flexitarian-biodiesel-chillwave-cliche-" + "ethical-cardigan-listicle-pok-pok-sustainable-live-" + "edge-jianbing-gochujang-butcher-disrupt-tattooed-" + "tumeric-prism-photo-booth-vape-kogi-jean-shorts-" + "blog-williamsburg-fingerstache-palo-santo-artisan-" + "affogato-occupy-skateboard-adaptogen-neutra-celiac-" + "put-a-bird-on-it-kombucha-everyday-carry-hot-chicken-" + "craft-beer-subway-tile-tote-bag-disrupt-selvage-" + "raclette-art-party-readymade-paleo-heirloom-trust-" + "fund-small-batch-kinfolk-woke-cardigan-prism-" + "chambray-la-croix-hashtag-unicorn-edison-bulb-tbh-" + "cornhole-cliche-tattooed-green-juice-adaptogen-" + "kitsch-lo-fi-vexillologist-migas-gentrify-" + "viral-raw-denim"; + const struct argpar_opt_descr descrs[] = { + { 0, '\0', opt_name, true }, + ARGPAR_OPT_DESCR_SENTINEL + }; + char cmdline[1024]; + + sprintf(cmdline, "--%s=23", opt_name); + test_succeed(cmdline, cmdline, descrs, 1); + } } /* @@ -880,7 +909,7 @@ void fail_tests(void) int main(void) { - plan_tests(423); + plan_tests(434); succeed_tests(); fail_tests(); return exit_status();