Skip to content

Commit

Permalink
test-lib: provide case insensitivity as a prerequisite
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Michael J Gruber authored and gitster committed Jul 27, 2012
1 parent 04083f2 commit ac39aa6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 4 additions & 0 deletions t/README
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------------

Expand Down
10 changes: 0 additions & 10 deletions t/t0003-attributes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" &&
Expand Down
6 changes: 6 additions & 0 deletions t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,12 @@ test_lazy_prereq SYMLINKS '
ln -s x y && test -h y
'

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

0 comments on commit ac39aa6

Please sign in to comment.