summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2017-02-01 10:42:45 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2017-02-01 10:42:45 +0900
commit0e25f1cb4d8057c428280baf49df8bd26415e76b (patch)
treef2a041f8120e5d96995cb780a8f2b0879020d23b
parente641e40940c41f503da28746c180d1375a1b0474 (diff)
downloadzsh-0e25f1cb4d8057c428280baf49df8bd26415e76b.tar.gz
zsh-0e25f1cb4d8057c428280baf49df8bd26415e76b.zip
40470: make the test work also with ASCII collation
a few OSs (macOS and some versions of BSDs) use ASCII collation even if UTF-8 locale is in use
-rw-r--r--ChangeLog5
-rw-r--r--Test/D07multibyte.ztst30
2 files changed, 19 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 74a4844ca..f38a5fe12 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-02-01 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
+
+ * 40470: Test/D07multibyte.ztst: make the test work also on
+ OSs which always use ASCII collation (e.g. macOS).
+
2017-01-31 Peter Stephenson <p.stephenson@samsung.com>
* 40466: Makefile.in: update depencencies so autoheader is run
diff --git a/Test/D07multibyte.ztst b/Test/D07multibyte.ztst
index 0ff65c707..e20315340 100644
--- a/Test/D07multibyte.ztst
+++ b/Test/D07multibyte.ztst
@@ -551,22 +551,20 @@
: $functions)
0:Multibyte handling of functions parameter
- if [[ -n ${$(locale -a 2>/dev/null)[(R)pl_PL.(utf8|UTF-8)]} ]]; then
- (
- export LC_ALL=pl_PL.UTF-8
- local -a names=(a b c d e f $'\u0105' $'\u0107' $'\u0119')
- print -o $names
- mkdir -p plchars
- cd plchars
- touch $names
- print ?
- )
- else
- ZTST_skip="No Polish UTF-8 locale found, skipping sort test"
- fi
-0:Sorting of metafied Polish characters
->a ą b c ć d e ę f
->a ą b c ć d e ę f
+# c1=U+0104 (Ą) and c2=U+0120 (Ġ) are chosen so that
+# u1 = utf8(c1) = c4 84 < u2 = utf8(c2) = c4 a0
+# metafy(u1) = c4 83 a4 > metafy(u2) = c4 83 80
+# in both UTF-8 and ASCII collations (the latter is used in macOS
+# and some versions of BSDs).
+ local -a names=( $'\u0104' $'\u0120' )
+ print -o $names
+ mkdir -p colltest
+ cd colltest
+ touch $names
+ print ?
+0:Sorting of metafied characters
+>Ą Ġ
+>Ą Ġ
printf '%q%q\n' 你你
0:printf %q and quotestring and general metafy / token madness