git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: git@vger.kernel.org
Cc: tboegi@web.de
Subject: [PATCH 4/5] test-lib: provide UTF8 behaviour as a prerequisite
Date: Thu, 26 Jul 2012 15:39:56 +0200	[thread overview]
Message-ID: <2d9b28dacc3e83d7aab1c3266bfbc53a3d3db906.1343309173.git.git@drmicha.warpmail.net> (raw)
In-Reply-To: <5001B82B.1060201@web.de>
In-Reply-To: <cover.1343309173.git.git@drmicha.warpmail.net>

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>
---
 t/README              |  5 +++++
 t/t0050-filesystem.sh | 24 +++++++-----------------
 t/test-lib.sh         | 14 ++++++++++++++
 3 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/t/README b/t/README
index 5725607..e4128e5 100644
--- a/t/README
+++ b/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.
 
+ - 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
 ----------------------
 
diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh
index b46ae72..78816d9 100755
--- a/t/t0050-filesystem.sh
+++ b/t/t0050-filesystem.sh
@@ -7,22 +7,6 @@ test_description='Various filesystem issues'
 auml=$(printf '\303\244')
 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
 then
 	say "will test on a case insensitive filesystem"
@@ -31,8 +15,14 @@ else
 	test_case=test_expect_success
 fi
 
-test "$unibad" &&
+if test_have_prereq UTF8_NFD_TO_NFC
+then
 	say "will test on a unicode corrupting filesystem"
+	test_unicode=test_expect_failure
+else
+	test_unicode=test_expect_success
+fi
+
 test_have_prereq SYMLINKS ||
 	say "will test on a filesystem lacking symbolic links"
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 57fc1f2..057ac1d 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -676,3 +676,17 @@ then
 	test_set_prereq CASE_INSENSITIVE_FS
 fi
 rm -rf junk
+
+# check whether FS converts nfd unicode to nfc
+auml=$(printf '\303\244')
+aumlcdiar=$(printf '\141\314\210')
+
+mkdir junk &&
+>junk/"$auml" &&
+case "$(cd junk && echo *)" in
+"$aumlcdiar")
+	test_set_prereq UTF8_NFD_TO_NFC
+	;;
+*)	;;
+esac
+rm -fr junk
-- 
1.7.12.rc0.198.gd66b616

  parent reply	other threads:[~2012-07-26 13:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-14 17:52 [PATCH] t3910: give reason for skipping the test Michael J Gruber
2012-07-14 18:19 ` Torsten Bögershausen
2012-07-26 13:39   ` [PATCH 0/5] test-lib: filesystem prerequisites Michael J Gruber
2012-07-26 13:39     ` [PATCH 1/5] test-lib: provide case insensitivity as a prerequisite Michael J Gruber
2012-07-26 13:39     ` [PATCH 2/5] t0050: use the CASE_INSENSITIVE_FS test prereq Michael J Gruber
2012-07-26 13:39     ` [PATCH 3/5] t0050: use the SYMLINKS " Michael J Gruber
2012-07-26 13:39     ` Michael J Gruber [this message]
2012-07-26 13:39     ` [PATCH 5/5] t3910: " Michael J Gruber
2012-07-26 18:16     ` [PATCH 0/5] test-lib: filesystem prerequisites Junio C Hamano
2012-07-26 18:43       ` Jeff King
2012-07-26 20:10         ` Junio C Hamano
2012-07-27  9:31           ` Michael J Gruber
2012-07-27 17:29             ` Junio C Hamano
2012-07-30  9:56               ` Michael J Gruber
2012-07-30  9:57               ` [PATCHv2 5/5] t3910: use the UTF8_NFD_TO_NFC test prereq Michael J Gruber
2012-07-30 15:29                 ` Junio C Hamano
2012-08-04  5:37                 ` Torsten Bögershausen
2012-08-04 22:04                   ` Junio C Hamano
2012-08-06 12:44                     ` Michael J Gruber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d9b28dacc3e83d7aab1c3266bfbc53a3d3db906.1343309173.git.git@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).