test-lib: provide case insensitivity as a prerequisite

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>

Michael J Gruber committed Jul 26, 2012 at 15:39 UTC ac39aa612147b595e02876a4c9d6ca7e8063ba3d
3 files changed +10 -10
t/README
+4
@@ -625,6 +625,10 @@ use these, and "test_set_prereq" for how to define your own.
625 Git was compiled with USE_LIBPCRE=YesPlease. Wrap any tests
626 that use git-grep --perl-regexp or git-grep -P in these.
627
628 + - CASE_INSENSITIVE_FS
629 +
630 + Test is run on a case insensitive file system.
631 +
632 Tips for Writing Tests
633 ----------------------
634
t/t0003-attributes.sh
-10
@@ -123,16 +123,6 @@ test_expect_success 'attribute matching is case insensitive when core.ignorecase
123
124 '
125
126 -test_expect_success 'check whether FS is case-insensitive' '
127 - mkdir junk &&
128 - echo good >junk/CamelCase &&
129 - echo bad >junk/camelcase &&
130 - if test "$(cat junk/CamelCase)" != good
131 - then
132 - test_set_prereq CASE_INSENSITIVE_FS
133 - fi
134 -'
135 -
126 test_expect_success CASE_INSENSITIVE_FS 'additional case insensitivity tests' '
127 test_must_fail attr_check a/B/D/g "a/b/d/*" "-c core.ignorecase=0" &&
128 test_must_fail attr_check A/B/D/NO "a/b/d/*" "-c core.ignorecase=0" &&
t/test-lib.sh
+6
@@ -664,6 +664,12 @@ test_lazy_prereq SYMLINKS '
664 ln -s x y && test -h y
665 '
666
667 +test_lazy_prereq CASE_INSENSITIVE_FS '
668 + echo good >CamelCase &&
669 + echo bad >camelcase &&
670 + test "$(cat CamelCase)" != good
671 +'
672 +
673 # When the tests are run as root, permission tests will report that
674 # things are writable when they shouldn't be.
675 test -w / || test_set_prereq SANITY