From c97ee171a6b5a7e41234d46341b496146fa08bf1 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Sun, 24 Sep 2017 21:08:03 -0700 Subject: t0040,t1502: Demonstrate parse_options bugs When the option spec contains no switches or only hidden switches, parse_options will emit an extra blank line at the end of help output so that the help text will end in two blank lines instead of one. When parse_options produces internal help output after an error has occurred it will emit blank lines within the usage string to stdout instead of stderr. Update t/helper/test-parse-options.c to have a description body in the usage string to exercise this second bug and mark tests as failing in t0040. Add tests to t1502 to demonstrate both of these problems. Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- t/helper/test-parse-options.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 't/helper') diff --git a/t/helper/test-parse-options.c b/t/helper/test-parse-options.c index 75fe883aac..630c76d127 100644 --- a/t/helper/test-parse-options.c +++ b/t/helper/test-parse-options.c @@ -99,6 +99,8 @@ int cmd_main(int argc, const char **argv) const char *prefix = "prefix/"; const char *usage[] = { "test-parse-options ", + "", + "A helper function for the parse-options API.", NULL }; struct string_list expect = STRING_LIST_INIT_NODUP; -- cgit v1.2.3