help / color / mirror / code / Atom feed
From: "Jun. T" <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: Deprecation of egrep
Date: Sat, 24 Sep 2022 02:14:35 +0900	[thread overview]
Message-ID: <912F4E5D-5EBD-45D6-B7BC-0F93CD12C657@kba.biglobe.ne.jp> (raw)
In-Reply-To: <B053B137-F183-4E23-ACC4-A5FD47FDCD6D@kba.biglobe.ne.jp>

> 2022/09/13 13:33, Jun T <takimoto-j@kba.biglobe.ne.jp> wrote:
> In the path below, I moved the repeated code for finding UTF-8 locale
> to a single function in ztst.zsh. The only other use of egrep is
> in E01options.zsh.

Sorry, with this patch D07 fails if users explicitly export LC_CTYPE=C
when running the test. Unsetting LC_\* in ZTST_find_UTF8() is not

I think we can simply unset LC_\* in ztst.zsh for ALL the tests
and rely only on LANG.

diff --git a/Test/ztst.zsh b/Test/ztst.zsh
index d95b726e7..ea1b016d5 100755
--- a/Test/ztst.zsh
+++ b/Test/ztst.zsh
@@ -25,23 +25,13 @@
 # still not be good enough.  Maybe we should trick it somehow.
 emulate -R zsh
-# Ensure the locale does not screw up sorting.  Don't supply a locale
-# unless there's one set, to minimise problems.
-[[ -n $LC_ALL ]] && LC_ALL=C
-[[ -n $LC_CTYPE ]] && LC_CTYPE=C
-[[ -n $LANG ]] && LANG=C
-# Test file may (or may not) set LANG to other locales. In either case,
-# LANG must be passed to child zsh.
-export LANG
+# By default tests are run in C locale. LANG must be passed to child zsh.
+unset -m LC_\*
+export LANG=C
 # find UTF-8 locale
 ZTST_find_UTF8 () {
   setopt multibyte
-  # Don't let LC_* override our choice of locale.
-  unset -m LC_\*
   local langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8
                ${(M)$(locale -a 2>/dev/null):#*.(utf8|UTF-8)})
   for LANG in $langs; do

  reply	other threads:[~2022-09-23 17:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-10 16:04 Vin Shelton
2022-09-10 17:26 ` Ellenor Bjornsdottir
2022-09-12  5:32   ` Jun T
2022-09-12  7:30     ` Jun T
2022-09-12  9:08       ` Daniel Shahaf
2022-09-12 10:15         ` Jun T
2022-09-12 10:49           ` Peter Stephenson
2022-09-12 15:27             ` Vin Shelton
2022-09-13  4:33               ` Jun T
2022-09-23 17:14                 ` Jun. T [this message]
2022-09-11  0:10 ` Bart Schaefer

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:

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

  git send-email \
    --in-reply-to=912F4E5D-5EBD-45D6-B7BC-0F93CD12C657@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \


* 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


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 NNTP newsgroup(s).