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

[PATCH 3/2] test-lib: provide case insensitivity as a prerequisite

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 26, 2012, 23:19 UTC
Message-ID
<7v394e5cv5.fsf_-_@alter.siamese.dyndns.org>
In-Reply-To
<7v7gtq5da3.fsf@alter.siamese.dyndns.org>

And on top, Michael's [1/5] would become like this, and [2/5] would apply unchanged.

-- >8 --
From: Michael J Gruber <git@drmicha.warpmail.net>
Date: Thu, 26 Jul 2012 15:39:53 +0200

Case insensitivity plays a role in several tests and is tested in several tests. Therefore, move the test from t003 into the test lib and use the prerequisite in t0003.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/README              |  4 ++++
 t/t0003-attributes.sh | 10 ----------
 t/test-lib.sh         |  6 ++++++
 3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/t/README b/t/README
index 4c3ea25..5725607 100644
--- a/t/README
+++ b/t/README
@@ -625,6 +625,10 @@ use these, and "test_set_prereq" for how to define your own.
    Git was compiled with USE_LIBPCRE=YesPlease. Wrap any tests
    that use git-grep --perl-regexp or git-grep -P in these.
 
+ - CASE_INSENSITIVE_FS
+
+   Test is run on a case insensitive file system.
+
 Tips for Writing Tests
 ----------------------
 
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
index 51f3045..febc45c 100755
--- a/t/t0003-attributes.sh
+++ b/t/t0003-attributes.sh
@@ -123,16 +123,6 @@ test_expect_success 'attribute matching is case insensitive when core.ignorecase
 
 '
 
-test_expect_success 'check whether FS is case-insensitive' '
-	mkdir junk &&
-	echo good >junk/CamelCase &&
-	echo bad >junk/camelcase &&
-	if test "$(cat junk/CamelCase)" != good
-	then
-		test_set_prereq CASE_INSENSITIVE_FS
-	fi
-'
-
 test_expect_success CASE_INSENSITIVE_FS 'additional case insensitivity tests' '
 	test_must_fail attr_check a/B/D/g "a/b/d/*" "-c core.ignorecase=0" &&
 	test_must_fail attr_check A/B/D/NO "a/b/d/*" "-c core.ignorecase=0" &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 878d000..52cb32a 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -664,6 +664,12 @@ test_lazy_prereq SYMLINKS '
 	ln -s x y 2>/dev/null && test -h y 2>/dev/null
 '
 
+test_lazy_prereq CASE_INSENSITIVE_FS '
+	echo good >CamelCase &&
+	echo bad >camelcase &&
+	test "$(cat CamelCase)" != good
+'
+
 # When the tests are run as root, permission tests will report that
 # things are writable when they shouldn't be.
 test -w / || test_set_prereq SANITY
-- 
1.7.12.rc0.44.gc69a8ad
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 7 in “test: rename $satisfied to $satisfied_prereq”
  1. 1/2 test: rename $satisfied to $satisfied_prereqJunio C Hamano, Jul 26, 2012
  2. 2/2 test: allow prerequisite to be evaluated lazilyJunio C Hamano, Jul 26, 2012
  3. 3/2 test-lib: provide case insensitivity as a prerequisiteJunio C Hamano, Jul 26, 2012
  4. 4/2 test-lib: provide UTF8 behaviour as a prerequisiteJunio C Hamano, Jul 26, 2012
  5. Jeff KingJul 27, 2012
  6. Jeff KingJul 27, 2012
  7. Junio C HamanoJul 27, 2012

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.