From: Pranit Bauva Date: Sat, 09 Apr 2016 12:23:20 GMT Subject: [PATCH v13 3/6] t0040-parse-options: improve test coverage Message-ID: <01020153faf9fcbf-e99e4a5b-b892-4e4a-8de5-84ee4315f01d-000000@eu-west-1.amazonses.com> In-Reply-To: <01020153faf9fc14-e6ad18fa-c892-4601-bab7-e2cc4cd9e100-000000@eu-west-1.amazonses.com> Include tests to check for multiple levels of quiet and to check if the '--no-quiet' option sets it to 0. Signed-off-by: Pranit Bauva --- t/t0040-parse-options.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh index 450da45..c913d1c 100755 --- a/t/t0040-parse-options.sh +++ b/t/t0040-parse-options.sh @@ -476,4 +476,41 @@ test_expect_success '--no-list resets list' ' test_cmp expect output ' +cat >expect <<\EOF +boolean: 0 +integer: 0 +magnitude: 0 +timestamp: 0 +string: (not set) +abbrev: 7 +verbose: 0 +quiet: 3 +dry run: no +file: (not set) +EOF + +test_expect_success 'multiple quiet levels' ' + test-parse-options -q -q -q >output 2>output.err && + test_must_be_empty output.err && + test_cmp expect output +' + +cat >expect <<\EOF +boolean: 0 +integer: 0 +magnitude: 0 +timestamp: 0 +string: (not set) +abbrev: 7 +verbose: 0 +quiet: 0 +dry run: no +file: (not set) +EOF + +test_expect_success '--no-quiet sets quiet to 0' ' + test-parse-options --no-quiet >output 2>output.err && + test_must_be_empty output.err && + test_cmp expect output +' test_done -- https://github.com/git/git/pull/218