From: "Jun. T" <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: (LC_ALL=C; set -x 128 129; printf "%s\n" ${(#)@} | hexdump -C)
Date: Mon, 11 Sep 2023 21:11:25 +0900 [thread overview]
Message-ID: <C4E4AB11-41FC-4EA8-8B8A-C531241E2429@kba.biglobe.ne.jp> (raw)
In-Reply-To: <968697743.3642134.1694422642580@mail.virginmedia.com>
This is some test for (#) and (#X).
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 0d44558a7..12ae1a446 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -2785,3 +2785,43 @@ F:behavior, see http://austingroupbugs.net/view.php?id=888
>string with spaces
>stringwithspaces
>stringwithspaces
+
+ : ${(#X):-@}
+1:${(#X)...}: bad math expression
+?(eval):1: bad math expression: illegal character: @
+
+ echo a${(#):-@}z
+0:${(#)...}: bad math expression
+>az
+
+ printf "a%sz\n" ${(#):-@}
+0:${(#)...}: bad math expression, printf
+>az
+
+ a=( '1 +' '@' )
+ : ${(#X)a}
+1:${(#X)...}: array of bad math expressions
+?(eval):2: bad math expression: operand expected at end of string
+
+ printf "a%sz\n" ${(#)a}
+0:${(#)...}: array of bad math expressions, printf
+>az
+
+ : ${(#X):-0x80}
+1:${(#X)...}: out-of-range character
+?(eval):1: character not in range
+
+ [[ ${(#):-0x80} = $'\x80' ]] && echo OK
+0:${(#)...}: out-of-range character
+>OK
+
+ a=( 0x80 0x81 )
+ : ${(#X)a}
+1:${(#X)...}: array of out-of-range characters
+?(eval):2: character not in range
+
+ printf "%s\n" ${(#)a} |
+ while read x; do echo $(( #x )); done
+0:${(#)...}: array of out-of-range characters
+>128
+>129
next prev parent reply other threads:[~2023-09-11 12:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-30 7:27 Stephane Chazelas
2023-08-30 19:45 ` Bart Schaefer
2023-08-31 17:38 ` Jun. T
2023-09-07 14:26 ` Jun. T
2023-09-07 16:33 ` Peter Stephenson
2023-09-08 16:30 ` Jun. T
2023-09-11 8:57 ` Peter Stephenson
2023-09-11 12:11 ` Jun. T [this message]
2023-09-13 9:59 ` Jun T
2023-09-21 9:26 ` Jun T
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C4E4AB11-41FC-4EA8-8B8A-C531241E2429@kba.biglobe.ne.jp \
--to=takimoto-j@kba.biglobe.ne.jp \
--cc=zsh-workers@zsh.org \
/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://git.vuxu.org/mirror/zsh/
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).