EOF
+ cat >expect-noop <<\EOF
+ --[no-]obsolete no-op (backward compatibility)
+ EOF
+
+ cat >expect-hidden <<\EOF
+ Hidden options
+ --[no-]hidden-bool get a boolean
+ -k, --[no-]hidden-integer <n>
+ get a integer
+
+ EOF
+
test_expect_success 'test help' '
- test_must_fail test-tool parse-options -h >output 2>output.err &&
+ cat expect-part1 expect-part2 >expect &&
+ test-tool parse-options -h >output 2>output.err &&
test_must_be_empty output.err &&
test_cmp expect output
'
- test_must_fail test-tool parse-options --help-all >output 2>output.err &&
+ test_expect_success 'test --help-all shows hidden group and options' '
+ cat expect-part1 expect-noop expect-part2 expect-hidden >expect-help-all &&
++ test-tool parse-options --help-all >output 2>output.err &&
+ test_must_be_empty output.err &&
+ test_cmp expect-help-all output
+ '
+
mv expect expect.err
check () {