All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Alex Henrie" <alexhenrie24@gmail.com>,
	"Felipe Contreras" <felipe.contreras@gmail.com>,
	"Fabian Stelzer" <fabian.stelzer@campoint.net>,
	"Jeff King" <peff@peff.net>,
	"Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>,
	"SZEDER Gábor" <szeder.dev@gmail.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v3 1/3] test-lib-functions.sh: rename test_must_fail_acceptable()
Date: Thu,  5 Aug 2021 01:05:44 +0200	[thread overview]
Message-ID: <patch-v3-1.3-f45590a76d5-20210804T230335Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-v3-0.3-00000000000-20210804T230335Z-avarab@gmail.com>

The test_must_fail_acceptable() is really a generic function that can
check if something is a real "git command", e.g. "git", "test-tool"
etc. Let's rename it in preparation for using it in another test
function.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/test-lib-functions.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index e28411bb75a..37da7d9a99a 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -895,7 +895,7 @@ list_contains () {
 # accepted by test_must_fail(). If the command is run with env, the env
 # and its corresponding variable settings will be stripped before we
 # test the command being run.
-test_must_fail_acceptable () {
+is_git_command_name () {
 	if test "$1" = "env"
 	then
 		shift
@@ -943,7 +943,7 @@ test_must_fail_acceptable () {
 #     (Don't use 'success', use 'test_might_fail' instead.)
 #
 # Do not use this to run anything but "git" and other specific testable
-# commands (see test_must_fail_acceptable()).  We are not in the
+# commands (see is_git_command_name()).  We are not in the
 # business of vetting system supplied commands -- in other words, this
 # is wrong:
 #
@@ -963,7 +963,7 @@ test_must_fail () {
 		_test_ok=
 		;;
 	esac
-	if ! test_must_fail_acceptable "$@"
+	if ! is_git_command_name "$@"
 	then
 		echo >&7 "test_must_fail: only 'git' is allowed: $*"
 		return 1
-- 
2.33.0.rc0.597.gc569a812f0a


  reply	other threads:[~2021-08-04 23:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-14 12:39 progress test failure on fedora34 Fabian Stelzer
2021-07-14 15:35 ` Ævar Arnfjörð Bjarmason
2021-07-14 16:35   ` Alex Henrie
2021-07-18  8:05     ` Ævar Arnfjörð Bjarmason
2021-07-19  9:00       ` Jeff King
2021-07-19 17:18       ` Alex Henrie
2021-07-19 18:21         ` Alex Henrie
2021-07-19 18:43       ` Felipe Contreras
2021-07-19 19:34         ` Felipe Contreras
2021-07-19 20:42           ` Alex Henrie
2021-07-20  0:40             ` Felipe Contreras
2021-07-21  0:45               ` ZheNing Hu
2021-07-21  2:50                 ` Felipe Contreras
2021-07-26 23:57             ` [PATCH] test-lib.sh: use GIT_TEST_COLUMNS over COLUMNS Ævar Arnfjörð Bjarmason
2021-07-27 17:38               ` Jeff King
2021-07-28  0:53                 ` Junio C Hamano
2021-08-02 13:46               ` [PATCH v2 0/3] " Ævar Arnfjörð Bjarmason
2021-08-02 13:46                 ` [PATCH v2 1/3] test-lib-functions.sh: rename test_must_fail_acceptable() Ævar Arnfjörð Bjarmason
2021-08-02 13:46                 ` [PATCH v2 2/3] test-lib-functions.sh: add a test_with_columns function Ævar Arnfjörð Bjarmason
2021-08-02 17:14                   ` SZEDER Gábor
2021-08-02 17:24                     ` Eric Sunshine
2021-08-02 13:46                 ` [PATCH v2 3/3] test-lib.sh: use GIT_TEST_COLUMNS over COLUMNS Ævar Arnfjörð Bjarmason
2021-08-04 23:05                 ` [PATCH v3 0/3] " Ævar Arnfjörð Bjarmason
2021-08-04 23:05                   ` Ævar Arnfjörð Bjarmason [this message]
2021-08-04 23:05                   ` [PATCH v3 2/3] test-lib-functions.sh: add a test_with_columns function Ævar Arnfjörð Bjarmason
2021-08-04 23:05                   ` [PATCH v3 3/3] test-lib.sh: use GIT_TEST_COLUMNS over COLUMNS Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=patch-v3-1.3-f45590a76d5-20210804T230335Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=alexhenrie24@gmail.com \
    --cc=fabian.stelzer@campoint.net \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=sunshine@sunshineco.com \
    --cc=szeder.dev@gmail.com \
    --cc=zbyszek@in.waw.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.