From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15290 invoked by alias); 29 Mar 2017 07:18:17 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40910 Received: (qmail 20247 invoked from network); 29 Mar 2017 07:18:17 -0000 X-Qmail-Scanner-Diagnostics: from aok120.rev.netart.pl by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(85.128.245.120):SA:0(0.0/5.0):. Processed in 0.430118 secs); 29 Mar 2017 07:18:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: psprint@zdharma.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at zdharma.org does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new using ClamAV (15) Date: Wed, 29 Mar 2017 09:18:14 +0200 From: Sebastian Gniazdowski To: zsh-workers@zsh.org Message-ID: In-Reply-To: References: Subject: Re: Tests for substitutions X-Mailer: Airmail (231) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline PS. I was grepping for match=5C=5C=5C=5B, but this doesn't equal substitu= tions, isn't even directly related. Grepping =22zipp=22 reveals that this= is tested. So, I just submit a new test that stresses multiple flags, an= d tests code execution with (=23b) On 29 marca 2017 at 09:04:18, Sebastian Gniazdowski (psprint=40zdharma.or= g) wrote: > Hello, > I'm little anxious about future of ZUI, despite that it works from Zsh-= 4.3.17 to 5.3.1-dev.0, =20 > because it uses very much power that Zsh has. In e.g. Python it wouldn'= t be possible to =20 > do what follows: > =20 > - create hyperlink text with 3 backend variables, that is turned into U= nicode text =E2=80=93 with =20 > 1 substitution > =20 > The substitution uses P,Q,A,s,r,m flags. I've created a test for it. Hy= perlink is created =20 > as follows: > =20 > my=5Fwidth=3D6 > my=5Findex=3D1 > my=5Foptions=3DOption1 > hyperlink=3D=24'=5C034'=22MYID=22=24'=5C034'=22DATA1=22=24'=5C034'=22DA= TA2=22=24'=5C034'=22DATA3=22=24'=5C034'=22my=5Fwidth=22=24'=5C034'=22my=5F= index=22=24'=5C034'=22my=5Foptions=22=24'=5C02' =20 > =20 > The substitution is: > =20 > array=3D( =22=24=7Barray=5B=40=5D//(=23b).../=24=7B(mr:=24=7B(P)=24=7B(= Q)match=5B1=5D=7D=7D:: :)=24=7B(As:;:)=24=7B(P)=24=7B(Q)match=5B3=5D=7D=7D= =7D=5B=24=7B(P)=24=7B(Q)match=5B2=5D=7D=7D=5D=7D=7D=22 =20 > ) > =20 > I've skipped the part that matches the three embedded parameters. So, a= ll is unicode-display-width =20 > padded and trimmed to =24=7B(P)match=5B1=5D=7D, my=5Foptions =24=7B(P)m= atch=5B3=5D=7D is splitted on ';', =20 > (A) makes (s) return array also for no-split-case, and this is indexed = with =24=7B(P)match=5B2=5D=7D =20 > =E2=80=93 with my=5Findex value. > =20 > Could this test be added=3F Because besides this, there are also no tes= ts for substitutions. =20 > The test stresses P,Q,A,s,r,m and code execution with (=23b), but I wou= ld also add some =20 > few tests for zipping, :=7C, :*, etc. Not that I aim at saturating subs= titution topic, just =20 > would ship few tests. > =20 > However, while the code works in shell, testing framework outputs: > (eval):6: unrecognized modifier =60T' > (eval):6: bad math expression: empty string > =20 > the =22bad math =E2=80=A6=22 usually comes from wrong backend parameter= name in hyperlink, but the =20 > code works fine in shell. Could someone look into testing framework=3F = It apparently does =20 > something with test's text. > =20 > -- > Sebastian Gniazdowski > psprint /at/ zdharma.org -- Sebastian Gniazdowski psprint /at/ zdharma.org