Re: [PATCH v3 3/3] vimdiff: integrate layout tests in the unit tests framework ('t' folder)
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Dec 1, 2021, 21:25 UTC
- Message-ID
- <211201.86ilw89fuz.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <20211130204333.174967-4-greenfoo@u92.eu>
On Tue, Nov 30 2021, Fernando Ramos wrote:
Show 28 quoted lines
> Create a new test case file for the different available merge tools.
> Right now it only tests the 'mergetool.vimdiff.layout' options. Other
> merge tools might be interested in adding their own tests here too.
>
> Signed-off-by: Fernando Ramos <greenfoo@u92.eu>
> ---
> mergetools/vimdiff | 2 +-
> t/t7609-mergetool--lib.sh | 17 +++++++++++++++++
> 2 files changed, 18 insertions(+), 1 deletion(-)
> create mode 100755 t/t7609-mergetool--lib.sh
>
> diff --git a/mergetools/vimdiff b/mergetools/vimdiff
> index 8614253ef1..5085e4ad0e 100644
> --- a/mergetools/vimdiff
> +++ b/mergetools/vimdiff
> @@ -552,6 +552,7 @@ merge_cmd_help() {
> esac
>
> return 0
> +
> }
>
>
> @@ -594,4 +595,3 @@ if test -n "$GIT_MERGETOOL_VIMDIFF_UNITTESTS"
> then
> run_unit_tests
> fi
> -Stray unrelated whitespace changes...
Show 14 quoted lines
> diff --git a/t/t7609-mergetool--lib.sh b/t/t7609-mergetool--lib.sh > new file mode 100755 > index 0000000000..35cc287124 > --- /dev/null > +++ b/t/t7609-mergetool--lib.sh > @@ -0,0 +1,17 @@ > +#!/bin/sh > + > +test_description='git mergetool > + > +Testing basic merge tools options' > + > +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main > +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
You don't seem to need this particular boilerplate, no?
Show 5 quoted lines
> + > +. ./test-lib.sh > + > +test_expect_success 'mergetool --tool=vimdiff creates the expected layout' ' > + GIT_MERGETOOL_VIMDIFF_UNITTESTS=1 bash $GIT_BUILD_DIR/mergetools/vimdiff
Don't use "bash", or if you do there should be appropriate prereqs to check whether bash is there etc. See some existing tests that really do mean to use it.