summaryrefslogtreecommitdiff
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-09-11 10:51:58 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-09-11 10:51:58 -0700
commit6508d0358d139336742676f88fd0248e54c8a59a (patch)
tree1e1827ad744befa9b64ae704ab07104d06120d85 /t/test-lib.sh
parentStart preparing for 1.7.12.1 (diff)
parentt3910: use the UTF8_NFD_TO_NFC test prereq (diff)
downloadtgif-6508d0358d139336742676f88fd0248e54c8a59a.tar.xz
Merge branch 'jc/test-prereq' into maint
* jc/test-prereq: t3910: use the UTF8_NFD_TO_NFC test prereq test-lib: provide UTF8 behaviour as a prerequisite t0050: use the SYMLINKS test prereq t0050: use the CASE_INSENSITIVE_FS test prereq test-lib: provide case insensitivity as a prerequisite test: allow prerequisite to be evaluated lazily test: rename $satisfied to $satisfied_prereq
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh26
1 files changed, 23 insertions, 3 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index bb4f8865b2..78c428619e 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -659,9 +659,29 @@ test_i18ngrep () {
fi
}
-# test whether the filesystem supports symbolic links
-ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
-rm -f y
+test_lazy_prereq SYMLINKS '
+ # test whether the filesystem supports symbolic links
+ ln -s x y && test -h y
+'
+
+test_lazy_prereq CASE_INSENSITIVE_FS '
+ echo good >CamelCase &&
+ echo bad >camelcase &&
+ 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
# things are writable when they shouldn't be.