git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Fernando RamosNext: Eric Sunshine
Message 7 of 9 in “vimdiff: new implementation with layout support”
  1. 0/3 vimdiff: new implementation with layout supportFernando Ramos, Nov 30, 2021
  2. 1/3 vimdiff: new implementation with layout supportFernando Ramos, Nov 30, 2021
  3. 2/3 vimdiff: add tool documentationFernando Ramos, Nov 30, 2021
  4. Ævar Arnfjörð BjarmasonDec 1, 2021
  5. Fernando RamosDec 4, 2021
  6. 3/3 vimdiff: integrate layout tests in the unit tests framework ('t' folder)Fernando Ramos, Nov 30, 2021
  7. Ævar Arnfjörð BjarmasonDec 1, 2021
  8. Eric SunshineDec 1, 2021
  9. Fernando RamosDec 1, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.