From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9306 invoked by alias); 29 Mar 2017 07:17:21 -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: 40909 Received: (qmail 21522 invoked from network); 29 Mar 2017 07:17:21 -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 1.229004 secs); 29 Mar 2017 07:17:21 -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 (14) Date: Wed, 29 Mar 2017 09:04:18 +0200 From: Sebastian Gniazdowski To: zsh-workers@zsh.org Message-ID: Subject: Tests for substitutions X-Mailer: Airmail (231) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="58db5c72_507ed7ab_17199" --58db5c72_507ed7ab_17199 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, I'm little anxious about future of ZUI, despite that it works from Zsh-4.= 3.17 to 5.3.1-dev.0, because it uses very much power that Zsh has. In e.g= . Python it wouldn't be possible to do what follows: - create hyperlink text with 3 backend variables, that is turned into Uni= code text =E2=80=93 with 1 substitution The substitution uses=C2=A0P,Q,A,s,r,m flags. I've created a test for it.= Hyperlink is created as follows: =C2=A0my=5Fwidth=3D6 =C2=A0my=5Findex=3D1 =C2=A0my=5Foptions=3DOption1 =C2=A0 =C2=A0 =C2=A0 =C2=A0hyperlink=3D=24'=5C034'=22MYID=22=24'=5C034'=22DATA1=22=24'=5C034'=22= DATA2=22=24'=5C034'=22DATA3=22=24'=5C034'=22my=5Fwidth=22=24'=5C034'=22my= =5Findex=22=24'=5C034'=22my=5Foptions=22=24'=5C02' The substitution is: 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 ) I've skipped the part that matches the three embedded parameters. So, all= is unicode-display-width padded and trimmed to =24=7B(P)match=5B1=5D=7D,= my=5Foptions =24=7B(P)match=5B3=5D=7D is splitted on ';', (A) makes (s) = return array also for no-split-case, and this is indexed with =24=7B(P)ma= tch=5B2=5D=7D =E2=80=93 with my=5Findex value. Could this test be added=3F Because besides this, there are also no tests= for substitutions. The test stresses=C2=A0P,Q,A,s,r,m and code execution= with (=23b), but I would also add some few tests for zipping, :=7C, :*, = etc. Not that I aim at saturating substitution topic, just would ship few= tests. However, while the code works in shell, testing framework outputs: (eval):6: unrecognized modifier =60T' (eval):6: bad math expression: empty string the =22bad math =E2=80=A6=22 usually comes from wrong backend parameter n= ame in hyperlink, but the code works fine in shell. Could someone look in= to testing framework=3F It apparently does something with test's text. -- Sebastian Gniazdowski psprint /at/ zdharma.org --58db5c72_507ed7ab_17199 Content-Type: text/plain Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D10subst.ztst.txt" IyBUZXN0cyBmb3Igc3Vic3RpdHV0aW9uCgolcHJlcAoKJXRlc3QKCiAgbXlfd2lkdGg9NgogIG15 X2luZGV4PTEKICBteV9vcHRpb25zPU9wdGlvbjEKICBoeXBlcmxpbms9JCdcMDM0JyJNWUlEIiQn XDAzNCciREFUQTEiJCdcMDM0JyJEQVRBMiIkJ1wwMzQnIkRBVEEzIiQnXDAzNCcibXlfd2lkdGgi JCdcMDM0JyJteV9pbmRleCIkJ1wwMzQnIm15X29wdGlvbnMiJCdcMDInCiAgYXJyYXk9KCAkaHlw ZXJsaW5rICJSZWd1bGFyIHRleHQiICRoeXBlcmxpbmsgKQogIGFycmF5PSggIiR7YXJyYXlbQF0v LygjYikkJ1wwMzQnW14kJ1wwMzQnXSMkJ1wwMzQnW14kJ1wwMzQnXSMkJ1wwMzQnW14kJ1wwMzQn XSMkJ1wwMzQnW14kJ1wwMzQnXSMkJ1wwMzQnKFteJCdcMDM0J10jKSQnXDAzNCcoW14kJ1wwMzQn XSMpJCdcMDM0JyhbXiQnXDAyJ10jKSQnXDAyJy8keyhtcjokeyhQKSR7KFEpbWF0Y2hbMV19fTo6 IDopJHsoQXM6OzopJHsoUCkkeyhRKW1hdGNoWzNdfX19WyR7KFApJHsoUSltYXRjaFsyXX19XX19 IiApCiAgcHJpbnQgLXJsIC0tICIke2FycmF5W0BdfSIKMDpUZXN0IHN1YnN0aXR1dGlvbiB0aGF0 IHVzZXMgUCxRLEEscyxyLG0gZmxhZ3MKPk9wdGlvbgo+UmVndWxhciB0ZXh0Cj5PcHRpb24K --58db5c72_507ed7ab_17199--