Re: [PATCH 1/3] t7006: add tests for how git config paginates
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 12, 2018, 22:17 UTC
- Message-ID
- <xmqq4lmlsvhr.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <450ff45707b58d6796d55cd594b50686e5d62fc2.1518365675.git.martin.agren@gmail.com>
Martin Ågren <martin.agren@gmail.com> writes:
Show 5 quoted lines
> +test_expect_success TTY 'git config respects pager.config when setting' ' > + rm -f paginated.out && > + test_terminal git -c pager.config config foo.bar bar && > + test -e paginated.out > +'
I am debating myself if this test should instead spell out what we eventually want from the above test and make it expect_failure, just like the next one.
In addition to setting (which will start ignoring pager in later steps), unsetting, replacing of a variable and renaming/removing a section in a configuration should not page, I would suspect. Should we test them all?
Show 32 quoted lines
> +test_expect_failure TTY 'git config --edit ignores pager.config' '
> + rm -f paginated.out editor.used &&
> + write_script editor <<-\EOF &&
> + touch editor.used
> + EOF
> + EDITOR=./editor test_terminal git -c pager.config config --edit &&
> + ! test -e paginated.out &&
> + test -e editor.used
> +'
> +
> +test_expect_success TTY 'git config --get defaults to not paging' '
> + rm -f paginated.out &&
> + test_terminal git config --get foo.bar &&
> + ! test -e paginated.out
> +'
> +
> +test_expect_success TTY 'git config --get respects pager.config' '
> + rm -f paginated.out &&
> + test_terminal git -c pager.config config --get foo.bar &&
> + test -e paginated.out
> +'
> +
> +test_expect_success TTY 'git config --list defaults to not paging' '
> + rm -f paginated.out &&
> + test_terminal git config --list &&
> + ! test -e paginated.out
> +'
> +
> +
> # A colored commit log will begin with an appropriate ANSI escape
> # for the first color; the text "commit" comes later.
> colorful() {