Skip to content

Commit ac39aa6

Browse files
Michael J Grubergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 04083f2 commit ac39aa6

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

t/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,10 @@ use these, and "test_set_prereq" for how to define your own.
625625
Git was compiled with USE_LIBPCRE=YesPlease. Wrap any tests
626626
that use git-grep --perl-regexp or git-grep -P in these.
627627

628+
- CASE_INSENSITIVE_FS
629+
630+
Test is run on a case insensitive file system.
631+
628632
Tips for Writing Tests
629633
----------------------
630634

t/t0003-attributes.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,6 @@ test_expect_success 'attribute matching is case insensitive when core.ignorecase
123123
124124
'
125125

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-
136126
test_expect_success CASE_INSENSITIVE_FS 'additional case insensitivity tests' '
137127
test_must_fail attr_check a/B/D/g "a/b/d/*" "-c core.ignorecase=0" &&
138128
test_must_fail attr_check A/B/D/NO "a/b/d/*" "-c core.ignorecase=0" &&

t/test-lib.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,12 @@ test_lazy_prereq SYMLINKS '
664664
ln -s x y && test -h y
665665
'
666666

667+
test_lazy_prereq CASE_INSENSITIVE_FS '
668+
echo good >CamelCase &&
669+
echo bad >camelcase &&
670+
test "$(cat CamelCase)" != good
671+
'
672+
667673
# When the tests are run as root, permission tests will report that
668674
# things are writable when they shouldn't be.
669675
test -w / || test_set_prereq SANITY

0 commit comments

Comments
 (0)