From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7370 invoked from network); 7 Feb 2023 00:34:36 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 Feb 2023 00:34:36 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1675730076; b=MC/nYpvQFzra4h+1eCAluQhJcyZlzt8Z2lBYxdjrzcLXVh4HP34efFBBSIqDZFaeTimEbNMfna +zOi4/RHJVCOLzvghDhgFLUHWBuz90A1cx9UyjoxAlejOuCMSYKoQxocNqxTauyp4R8IbSktWG y3TRGwg9YbyvE3KKNfS5F+/aWgDmjiS4Ydw1BFlDJajieGT27wz7W1mwKxhroaSUUY49twnSFf uBgmCtCidbNU1TCISfDKk+QoyT83gqCJs5L2n0lWozHZxfhaaB12rLA+gRCca/qBCEZ8e3Qi6O RuCWpoNWlnISQqN/tdpQi3TvP/RPhy3ywCYU7P261xdOoQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout3-smtp.messagingengine.com) smtp.remote-ip=64.147.123.19; dkim=pass header.d=daniel.shahaf.name header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1675730076; bh=hn+1BKSdW1M738NWFRSPR+xFZppXZLPm6byEhkSF0Fg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=nCqhas1fxAM2qjkwynTafBC0wMdJpjSsXGWTf79XMjOus9ZDEFPAmajbF6yURsjjGvb1bFu1Zi jnt97/gkLzGFz/r1kj7xtAGXDvhvCkVl+YaWUBJeKLNIc/H3VjyRhSjktwBEwbbNLQYOmWiCO4 rQNxAYoywwaoVn9Ixn0YWwZQDvXcR1uCsyOhK6T6VcoUbx6Yvb1N+Vso383OusJUO3EFpkgX7l cSsVm7fBTARk0o498AU0in0637lJ/Y7zqgxrog682xHlEsG0F62Xy/FxP5YUND9R2Vmh7vI4Lg J943lIZw3HAErx3uVAsM/pQyRiBvOTNvOWyFWT4ZjiXzNg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=cRpfuA2cWSv8jbw00rmVOCmOjHsjfBhPnO9Ea1kdQnI=; b=De95txixeSMB39817RQ/6D58Fh iPUQzCddVWjwDk5bwnr5IzraK2X6GlYXo3BB5x4kZmGS0NsXoRkqJiZSsoIc4Hj9+uYcMQ2kjMtXm sMNPv0Irklj8obzkkXLgVDuz4wyOxNJmPd3SdihIhEGomJe/GU90vm2WHxvd94zt6nWL19vjBHtg4 ZDBAScbidYGMMLoCgX7Hcl2CLFp48qVVsKRgepCbWSaJPWqJg1U6EyI3bbVMoMt2XxqvLW3snS/4Q cD0qpFM8c0xj0wgTLg9jsMRC7bz944t/mv3LAU61S7ftO1fislZncW9BbGLZs9F5Xm0JbUiaxJ+pB fKSpSRVw==; Received: by zero.zsh.org with local id 1pPBwR-000OHJ-Eq; Tue, 07 Feb 2023 00:34:35 +0000 Authentication-Results: zsh.org; iprev=pass (wout3-smtp.messagingengine.com) smtp.remote-ip=64.147.123.19; dkim=pass header.d=daniel.shahaf.name header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:40455) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1pPBvr-000NzI-HI; Tue, 07 Feb 2023 00:34:00 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 0B8B33200958; Mon, 6 Feb 2023 19:33:57 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 06 Feb 2023 19:33:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to; s=fm2; t=1675730037; x=1675816437; bh=cRpfuA2cWSv8jbw00rmVOCmOj HsjfBhPnO9Ea1kdQnI=; b=mO7DwsU50G+sSEwh5SNgZrl/DAHKhdVk7Rqs+eOgF rfrO3h3ifMmLQ3gJcugbami+W/+dpZHz5Ra+3mQcxKfGVv6n9Wij2KFvhQGc0IEv 5lpMvT26fQcriXRPpmk/n+iL19X/qiZVEHm7zFl5STv50n2zmM6nTCIF6u4UzSL7 TUGwoCm1nh7X0lKLUagvSEHb4b63LEWts2jRFNGmwIkmVw4a6efE3GSEQvlfQSH3 qylInoBIeCOeg8nnB4cYyuBpmmRknIciMi9W4FCys2vlIcm+FWh12G1KLPFwBjg8 P1P1gAd3ykD7twHHKDLDPAsPRTYtQ6SImTmxtQxVjGkKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1675730037; x=1675816437; bh=c RpfuA2cWSv8jbw00rmVOCmOjHsjfBhPnO9Ea1kdQnI=; b=cFl9E4JOu1ZAQqkMf BndlFOYzoktj+M7Lx5xPivkUPLLQ9wo4gIP96yPapofu05FlU3yRN6J3hwtbyLOF 78OX8B0+8UFML41LcBqlR5IvWnka8T/w/3JFcl8Y/6hIOuxj2XIQRx5FMtNXCvLk GD/T/gL056PdihIi6u+P2Uw92ub32POl7y4t7qtkho97yDDl5beU/wnLfP0Mg2t4 iSzZZVsO7NNkcFF+OKcoJlu4loyni9U1Tsyz/btcNrw27DzTD/TEwrMAxvIe9OCr MYfgAXbI0+b3oVUatqiO4rDp3bUVZthGAyNL0Q1TW3Odxc49nQhGPB1jtYmgiUrD cwZrw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudegjedgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggugfgjfgesth ektddttderjeenucfhrhhomhepffgrnhhivghlucfuhhgrhhgrfhcuoegurdhssegurghn ihgvlhdrshhhrghhrghfrdhnrghmvgeqnecuggftrfgrthhtvghrnhepgfekgfefjefgvd dvgfdutdelleekvdefteeitdduhfevveevudfhvdevfeefvdeunecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugdrshesuggrnhhivghlrdhshh grhhgrfhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i425e4195:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 6 Feb 2023 19:33:57 -0500 (EST) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1000) id 4P9kdb1Ky1zn5; Tue, 7 Feb 2023 00:33:55 +0000 (UTC) Date: Tue, 7 Feb 2023 00:33:55 +0000 From: Daniel Shahaf To: Zsh hackers list Subject: Re: [PATCH 2/3] Tests for named references Message-ID: <20230207003355.GB4460@tarpaulin.shahaf.local2> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Seq: 51367 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: Bart Schaefer wrote on Sun, Feb 05, 2023 at 18:24:58 -0800: > Forgot to mention in patch #1 email that I decided not to create a > "nameref" built-in yet. > > Here are the test cases, I covered everything I could think of. If > you see something I missed, let me know. > diff --git a/Test/K01nameref.ztst b/Test/K01nameref.ztst > new file mode 100644 > index 000000000..b38831100 > --- /dev/null > +++ b/Test/K01nameref.ztst Add "K:" to Test/README? > @@ -0,0 +1,439 @@ > +# Tests for the zsh/param/private module Copy-pasto. > +%prep > + > + # Required in order to declare an unset hash for substitution test > + setopt TYPESET_TO_UNSET > + > + : ${ZTST_continue:=1} > + > +%test > + > + 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? > + typeset -n ptr2='path[2]' > + print -r -- $ptr2 > +0d:nameref to array element > +>${path[2]} > + Did you mean "0q" rather than "0d"? I guess we should make the test harness warn (at least) when the "d" flag is present and expected stdout is not empty. ⋮ > +%clean 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. 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? > Haven't reviewed the V10private.ztst tests or the other two patches in this series. Cheers, Daniel P.S. I wonder if it'd be useful to write a scriptlet that takes a one-liner in argv and emits on stdout a test that runs the one-liner and expects its current exitcode/stdout/stderr. The idea is to use it along the lines of «Test/generate 'pwd' >> Test/B42pwd.ztst».