Re: [PATCH v14 3/6] t0040-parse-options: improve test coverage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 12, 2016 at 7:02 PM, Pranit Bauva <pranit.bauva@xxxxxxxxx> wrote:
> 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 <pranit.bauva@xxxxxxxxx>
> ---
> diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh
> @@ -476,4 +476,41 @@ test_expect_success '--no-list resets list' '
> +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 &&

Meh, as implemented, this isn't a very interesting test, is it?
'quiet' started at 0, so all this shows is that --no-quiet didn't
disturb the 0. To really test that it resets it to 0, you'd want:

    test-parse-options --quiet --no-quiet >... 2>... &&

> +       test_must_be_empty output.err &&
> +       test_cmp expect output
> +'
>  test_done
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]