aboutsummaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorBrandon Casey <drafnel@gmail.com>2017-09-24 21:08:03 -0700
committerJunio C Hamano <gitster@pobox.com>2017-09-25 14:35:50 +0900
commitc97ee171a6b5a7e41234d46341b496146fa08bf1 (patch)
tree8a4817d7c870c98c622c23a90cfe8927d742ce5b /t/helper
parent697bc8858114ddda705be6f6eb3f997b64efa659 (diff)
downloadgit-c97ee171a6b5a7e41234d46341b496146fa08bf1.tar.gz
git-c97ee171a6b5a7e41234d46341b496146fa08bf1.tar.xz
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 <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-parse-options.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/helper/test-parse-options.c b/t/helper/test-parse-options.c
index 75fe883aa..630c76d12 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 <options>",
+ "",
+ "A helper function for the parse-options API.",
NULL
};
struct string_list expect = STRING_LIST_INIT_NODUP;