Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] E02 test failure / ztst *> issue



On 11 Mar 2020, at 21:37, Jun T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
> I noticed this on macOS few days ago or so, and was testing on other BSDs,
> and yes, the test fails (at least) on Free/Net/Open BSDs. It turned out
> that the problem is in zsh itself; a patch is at the end of this post.

Oh, i'd just assumed it was a normal platform/locale difference.

On Mojave, your patch fixes the test for me only if i manually set LC_CTYPE or
LC_ALL to C when running `make check` — which didn't have any effect before,
so it is definitely an improvement. If i run it normally (where i have
LC_CTYPE=en_GB.UTF-8), it still fails in the same way.

We could set LC_CTYPE=C in ztst, but that'd cause problems for some of the
multi-byte tests. So should we just set it for this one test? If i combine
this patch with yours, everything passes for me.

dana


diff --git a/Test/E02xtrace.ztst b/Test/E02xtrace.ztst
index a5a7bc55c..77088001d 100644
--- a/Test/E02xtrace.ztst
+++ b/Test/E02xtrace.ztst
@@ -147,22 +147,25 @@
 ?+(anon):0> true
 ?+fn:0> gn
 
-  test_cases=(
-      f            # baseline
-      foo-bar      # Dash
-      ヌ           # Meta (the UTF-8 representation of this character has an 0x83 byte)
-      \$\'ba\\0z\' # Nul, escaped as though by ${(qqqq)}
+  (
+    LC_ALL=C # Make `which` output consistent
+    test_cases=(
+        f            # baseline
+        foo-bar      # Dash
+        ヌ           # Meta (the UTF-8 representation of this character has an 0x83 byte)
+        \$\'ba\\0z\' # Nul, escaped as though by ${(qqqq)}
+    )
+    for 1 in "$test_cases[@]"; do
+      eval "
+        ${1}() {
+          ${1}() { echo inner }
+        }
+        functions -T ${1}
+        ${1}
+        which ${1}
+      "
+    done
   )
-  for 1 in "$test_cases[@]"; do
-    eval "
-      ${1}() {
-        ${1}() { echo inner }
-      }
-      functions -T ${1}
-      ${1}
-      which ${1}
-    "
-  done
 0:a function that redefines itself preserves tracing
 >f () {
 >  # traced



Messages sorted by: Reverse Date, Date, Thread, Author