From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH 2/3] Tests for named references
Date: Mon, 6 Feb 2023 19:24:52 -0800 [thread overview]
Message-ID: <CAH+w=7bY_LuVoXcneaqvxj_KAVBcoeeLwwRK7CiKX8J=FQW2AQ@mail.gmail.com> (raw)
In-Reply-To: <20230207003355.GB4460@tarpaulin.shahaf.local2>
On Mon, Feb 6, 2023 at 4:36 PM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
>
> Bart Schaefer wrote on Sun, Feb 05, 2023 at 18:24:58 -0800:
]> > +++ b/Test/K01nameref.ztst
>
> Add "K:" to Test/README?
Forgot that file even existed. Added.
> > +# Tests for the zsh/param/private module
>
> Copy-pasto.
Fixed.
> > + typeset -n ptr=var
> > + typeset var=value
> > + unset ptr
> > + typeset -p var
> > +0:unset via nameref
> > +
>
> So this expects «typeset -p var» to return 0 and have no output. Are
> these the correct expectations?
Matches ksh93 to the best of my ability to test.
>
> > + typeset -n ptr2='path[2]'
> > + print -r -- $ptr2
> > +0d:nameref to array element
> > +>${path[2]}
> > +
>
> Did you mean "0q" rather than "0d"?
Indeed I did. Changed.
> How about tests for assigning to a nameref-to-hash? (Entire hash, not
> hash element) Or are these implied by the "assign to array" and "expand
> nameref-to-hash" tests.
I believe they are so implied.
> Also, in 1/3 you wrote "attempting to add an attribute to a named
> reference generates a warning", but I don't see a single test expecting
> a non-empty stderr?
Not sure what you mean here, there are lots of tests that expect a
zero exit status and check output only on stdout. The fifth test
specifically attempts adding the "tag" attribute to a named reference
and looks for the expected warning. In a number of cases I'm checking
that the state of variables has been restored to the expected state by
looking for both correct stdout of the earlier steps and "no such
variable" after the test is done, the intent being to catch any cases
where the nameref goes too far up the stack of scopes.
Consolidated patch for both proofreadings will follow if when there's
no futher discussion.
next prev parent reply other threads:[~2023-02-07 3:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-06 2:24 Bart Schaefer
2023-02-07 0:33 ` Daniel Shahaf
2023-02-07 3:24 ` Bart Schaefer [this message]
2023-02-07 9:28 ` Daniel Shahaf
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='CAH+w=7bY_LuVoXcneaqvxj_KAVBcoeeLwwRK7CiKX8J=FQW2AQ@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--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).