mirror of
https://github.com/git/git
synced 2024-09-20 17:01:35 +00:00
test-lib: provide UTF8 behaviour as a prerequisite
UTF8 behaviour of the filesystem (conversion from nfd to nfc) plays a role in several tests and is tested in several tests. Therefore, move the test from t0050 into the test lib and use the prerequisite in t0050. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
2b71b5221a
commit
5b0b5dd49b
5
t/README
5
t/README
|
@ -629,6 +629,11 @@ use these, and "test_set_prereq" for how to define your own.
|
||||||
|
|
||||||
Test is run on a case insensitive file system.
|
Test is run on a case insensitive file system.
|
||||||
|
|
||||||
|
- UTF8_NFD_TO_NFC
|
||||||
|
|
||||||
|
Test is run on a filesystem which converts decomposed utf-8 (nfd)
|
||||||
|
to precomposed utf-8 (nfc).
|
||||||
|
|
||||||
Tips for Writing Tests
|
Tips for Writing Tests
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
|
|
@ -7,22 +7,6 @@ test_description='Various filesystem issues'
|
||||||
auml=$(printf '\303\244')
|
auml=$(printf '\303\244')
|
||||||
aumlcdiar=$(printf '\141\314\210')
|
aumlcdiar=$(printf '\141\314\210')
|
||||||
|
|
||||||
unibad=
|
|
||||||
test_expect_success 'see what we expect' '
|
|
||||||
|
|
||||||
test_unicode=test_expect_success &&
|
|
||||||
mkdir junk &&
|
|
||||||
>junk/"$auml" &&
|
|
||||||
case "$(cd junk && echo *)" in
|
|
||||||
"$aumlcdiar")
|
|
||||||
test_unicode=test_expect_failure &&
|
|
||||||
unibad=t
|
|
||||||
;;
|
|
||||||
*) ;;
|
|
||||||
esac &&
|
|
||||||
rm -fr junk
|
|
||||||
'
|
|
||||||
|
|
||||||
if test_have_prereq CASE_INSENSITIVE_FS
|
if test_have_prereq CASE_INSENSITIVE_FS
|
||||||
then
|
then
|
||||||
say "will test on a case insensitive filesystem"
|
say "will test on a case insensitive filesystem"
|
||||||
|
@ -31,8 +15,14 @@ else
|
||||||
test_case=test_expect_success
|
test_case=test_expect_success
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test "$unibad" &&
|
if test_have_prereq UTF8_NFD_TO_NFC
|
||||||
|
then
|
||||||
say "will test on a unicode corrupting filesystem"
|
say "will test on a unicode corrupting filesystem"
|
||||||
|
test_unicode=test_expect_failure
|
||||||
|
else
|
||||||
|
test_unicode=test_expect_success
|
||||||
|
fi
|
||||||
|
|
||||||
test_have_prereq SYMLINKS ||
|
test_have_prereq SYMLINKS ||
|
||||||
say "will test on a filesystem lacking symbolic links"
|
say "will test on a filesystem lacking symbolic links"
|
||||||
|
|
||||||
|
|
|
@ -670,6 +670,19 @@ test_lazy_prereq CASE_INSENSITIVE_FS '
|
||||||
test "$(cat CamelCase)" != good
|
test "$(cat CamelCase)" != good
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_lazy_prereq UTF8_NFD_TO_NFC '
|
||||||
|
# check whether FS converts nfd unicode to nfc
|
||||||
|
auml=$(printf "\303\244")
|
||||||
|
aumlcdiar=$(printf "\141\314\210")
|
||||||
|
>"$auml" &&
|
||||||
|
case "$(echo *)" in
|
||||||
|
"$aumlcdiar")
|
||||||
|
true ;;
|
||||||
|
*)
|
||||||
|
false ;;
|
||||||
|
esac
|
||||||
|
'
|
||||||
|
|
||||||
# When the tests are run as root, permission tests will report that
|
# When the tests are run as root, permission tests will report that
|
||||||
# things are writable when they shouldn't be.
|
# things are writable when they shouldn't be.
|
||||||
test -w / || test_set_prereq SANITY
|
test -w / || test_set_prereq SANITY
|
||||||
|
|
Loading…
Reference in a new issue